문제

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

도움이 되었습니까?

해결책

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
}

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top