TYPO3 remove old language parameter

From snippet wiki
Jump to: navigation, search

If you still get old URL request from times before any relaunch including the L=1 language switch. Add those lines to your htaccess file:

RewriteCond %{QUERY_STRING} ^(.+?&|)L=[^&]*(?:&(.*)|)$ [NC]
RewriteRule ^ %{REQUEST_URI}?%1%2 [R=301,L]

Or redirect to language subdomains per id value (if nothing else for parameters)

RewriteCond %{QUERY_STRING} L=1
RewriteRule ^(.+) http://en.example.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} L=2
RewriteRule ^(.+) http://fr.example.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} L=3
RewriteRule ^(.+) http://it.example.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} L=4
RewriteRule ^(.+) http://sv.example.com/$1 [R=301,L]

Autoren der Seite / Contributors of the page

» Kai Kretschmann, (google+)