Giter VIP home page Giter VIP logo

de-slash's Introduction

Never have a trailing slash in your TYPO3 websites

With TYPO3, it is possible to have a trailing slash in your URLs, but also without them - depending on the use-case.

By default, TYPO3 does not have a trailing slash at the end of each URL, but there are some technical limitations, why it e.g. happens on the home page, where there is always a trailing slash.

You can configure an ending like ".html" or "/" for each URL, and have more enhancers for plugins.

This extension works in a naive way to remove trailing slashes from

  • All generated links
  • All your canonical URLs

It even redirects incoming URLs with a trailing slash into the same page without.

Configuration

Install the extension, ensure that all your site configuration base's for languages do NOT have a trailing slash

Good: base: 'https://example.com/en' Bad: base: 'https://example.com/en/'

Good: base: '/fr' Bad: base: '/fr/'

That's it.

Caveats

  • Ensure that you do not have a enhancer or PageType decorator that creates URLs (also for plugins) with a trailing slash.

  • Redirects will only work on GET or HEAD requests.

Pending Issues

  • How to deal with redirects from EXT:redirects
  • This is currently an "all-in" solution - you can't disable this feature on a per-site basis.

Credits

This extension was created by Benni Mack in 2023 for b13 GmbH, Stuttgart.

Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.

de-slash's People

Contributors

bmack avatar ervaude avatar o-ba avatar tim-obert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.