Google indexing fail miserably with magic locale detection
$request->getSession()->set('_locale', $preferred);
//Send vary header as current page locale depend on it
$request->getSession()->set('_locale', $preferred);
//Send vary header as current page locale depend on it
- header('Vary: accept-language');
+ #header('Vary: accept-language');
- $request->setLocale($preferred);
+ #$request->setLocale($preferred);
- $request->setDefaultLocale($preferred);
+ #$request->setDefaultLocale($preferred);
- $context = $this->router->getContext();
+ #$context = $this->router->getContext();
- $context->setParameter('_locale', $preferred);
+ #$context->setParameter('_locale', $preferred);
//Set back router context
//Set back router context
- $this->router->setContext($context);
+ #$this->router->setContext($context);