Home > Blockchain >  Contao redirects main page to its translated page
Contao redirects main page to its translated page

Time:09-17

The problem is, after using contao2xliff translatition extension when I load my website it would have 303 redirect and redirects to the translated english page(the website main language is Deutsch). all the other pages works fine, just the main page has this redirection error and always redirects to English page even after I change the language by language changer.

Some details!

In Site structure there is two root page one for the main language which is Deutsch and the other is the duplicate of the main for English translation.

Main                        -----> Website Root

    -Startseite                 --> alias is index


Main [en]                   -----> Website Root

    -Home page                  --> alias is main

When I open the website https://example.de, it redirects me to the english page https://example.de/home.html.

In the Network tab inside developer inspect it shows me 303 See Other error then it loads the English.

All the other page translations are working fine when changing the language back and force, but the main page always redirects to English.

Any Idea please?!

CodePudding user response:

That is the expected behaviour. If you use only one domain for all your languages and you make a request to the domain without any additional path, then Contao automatically responds with a redirect to the start page of the respective language depending on the Accept-Language request header. So if your browsers sends en as its primary language in the Accept-Language request header, then Contao will redirect you to the English start page, which in your case is https://example.de/home.html.

  • Related