0

I have an article with url alias '/gettting-started' and it is translated in several languages.

Lang codes for other languages is set like the following.

For German:de-de, English: en-us.

In 'admin/config/regional/language/detection' Detection and selection languages, priority is set to 'URL' then 'Browser'.

My browser locale set to German first,so when i try to visit the article with the /getting-started, it is redirected to /de-de/getting-started with the status 301.

The status code 301 is creating the problem for me as the response is cached at varnish cache (for 301 response codes).

The other user, with English as priority in Browser language visits /getting-started redirects to /de-de/getting-started

So, instead of sending 301, how can i send 302 redirect for urls without language code as a prefix.

1 Answer 1

1

That redirect isn't a drupal standard feature, it is done by the redirect.module.

It is currently using the default response header of the redirect configuration in \Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber::onKernelRequestRedirect(). That is a bit weird as that is the default for new manually created redirects which usually should be cached.

I think there is an issue in the redirect module to change that to a different configuration or always using 302, if not, feel free to create one.

1
  • Changing 'Default redirect status' in Redirect settings page worked for me.
    – jay
    Apr 16, 2018 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.