Pergunta

https://newsite.com to https://www.newsite.com results in a 302 redirect. Not sure from where this temporary redirect is coming. Site nginx configuration has only 301 redirects. Here is the configuration.

https://stackoverflow.com/questions/54603417/nginx-301-redirect-from-oldsite-to-newsite

Foi útil?

Solução

I guess the 302 redirect comes from Magento, because you call without the configured host in your url.

Try something like this in your nginx:

if ($host != 'www.newsite.com'){
    return 301 https://www.newsite.com$request_uri
}

Outras dicas

For each redirect, you can add the following line to your nginx configuration, inside of the location / block (first):

rewrite /old/url.html /new/url.html

I hope this will help

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top