0
votes

I have a typo3 webside with many different languages and I do not want people to access the default language with the exception for the frontpage.

http://example.com/us/home is fine
http://example.com/uk/home is fine
http://example.com/de/home is fine
http://example.com/home is not fine and shall be redirected to http://example.com
http://example.com/home/subpage is not fine and shall be redirect to http://example.com

http://example.com/XX/home XX does not exist as langauge so it will display the 404 page. This is fine.

I tried to play around with the noMatch and valueDefault Attributes in realURL without success.

Any idea? Or do I maybe need to use typoscript for that?

1

1 Answers

1
votes

Firsts, read how to set up properly languages with RealURL: https://github.com/dmitryd/typo3-realurl/wiki/Notes-for-Integrators#configuring-languages You have to follow that exactly!

Next, RealURL does not do redirects for you. It only encodes and decodes URLs. Yo should setup redirects with Apache. Something like:

RewriteCond %{REQUEST_URI} !^/((de|us|uk)/.*)$
RewriteRule .* /de/%1 [L,R=301]

This code is untested. Try & adjust as it fits you.