Skip to content

Nginx 301重定向

Nginx

@重定向到www

http 80

nginx
return 301 https://www.ioiox.com$request_uri;

https 443

nginx
if ($host = 'ioiox.com') {
    return 301 https://www.ioiox.com$request_uri;
}

www重定向到@

http 80

nginx
return 301 https://ioiox.com$request_uri;

https 443

nginx
if ($host = 'www.ioiox.com') {
    return 301 https://ioiox.com$request_uri;
}