nginx怎么设置301重定向

nginx设置301重定向的方法:

修改nginx中对应该网站的配置文件,例如:

#shuyeidc.com.conf

#301-START

if ($host ~ '^shuyeidc.com'){

return 301 http://shuyeidc.com$request_uri;

}

if ($host ~ '^shuyeidc.com'){

return 301 http://shuyeidc.com$request_uri;

}

#301-END

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/155280.html<

(0)
运维的头像运维
上一篇2025-03-15 09:02
下一篇 2025-03-15 09:03

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注