nginx設(shè)置域名301重定向的方法:
修改nginx中對(duì)應(yīng)該網(wǎng)站的配置文件,例如:
//判斷nginx核心變量hostserver {server_name www.123.com 123.com ;if ($host != 'www.123.com' ) {rewrite ^/(.*)$ http://www.123.com/$1 permanent;}...}
//判斷nginx核心變量host
server {
server_name www.123.com 123.com ;
if ($host != 'www.123.com' ) {
rewrite ^/(.*)$ http://www.123.com/$1 permanent;
}
...
億速云公眾號(hào)
手機(jī)網(wǎng)站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權(quán)所有
廣州億速云計(jì)算有限公司粵ICP備17096448號(hào)-1 粵公網(wǎng)安備 44010402001142號(hào)增值電信業(yè)務(wù)經(jīng)營(yíng)許可證編號(hào):B1-20181529