JMSI18nRoutingBundle icon indicating copy to clipboard operation
JMSI18nRoutingBundle copied to clipboard

Locale redirect only works for Homepage

Open aik099 opened this issue 7 years ago • 3 comments

According to documentation (see http://jmsyst.com/bundles/JMSI18nRoutingBundle/master/configuration) the prefix strategy should prefix all routes with locale. It does so, but only when generating/parsing routes.

There is also a fallback redirect for cases, when page without locale is accessed to redirect to same page with locale.

Unfortunately it has several issues:

  1. works only for homepage, e.g. / is redirected to /en/, but /something isn't redirected to /en/something
  2. the 302 redirect is made, but according to SEO it should be 301 redirect instead

File in question: https://github.com/schmittjoh/JMSI18nRoutingBundle/blob/master/EventListener/LocaleChoosingListener.php

aik099 avatar Sep 21 '17 18:09 aik099

Hi,

Same issue, Is there an option to achieve this example?

example: (default language is en)

/something -> redirect to /en/something /en/something --> /en/something /fr/something --> /fr/something

rmatcar avatar Apr 05 '18 20:04 rmatcar

Since this morning, the fallback didn't work nether. I continue to investigate.

EDIT It seems to be the symfony 3.4.7 (and the buildin server), I keep looking

Losams avatar Apr 06 '18 09:04 Losams

Fallback works on symfony 4.0.4 but not on 4.0.8. LocaleChoosingListener is not fired at all.

djukaPHP avatar Apr 13 '18 00:04 djukaPHP