站点的域名已升级。 必须启用新域名的使用。
但是,用户不知道,也可能使用旧域名访问网站。
必须将使用旧域名访问的源重定向到新域名。
语法:
#将当前域名的所有请求重定向至新域名www.lnmp.com rewrite/http://www.lnmp.com permanent #将重定向至301永久重定向,然后浏览器的浏览器
#shop.lnmp.com的要求均为www.lnmp.com的server { listen 80; server_name shop.lnmp.com; rewrite/http://www.lnmp.com permanent; - * * * }服务器{ listen 80; #绑定新域名即可访问server_name www.lnmp.com; --* * *根html/TP5shop/public; 索引索引. PHP索引. html; access _ loglogs/shop.lnmp.com _ access.log mylogs; 位置/{ rewrite/index.html/index.PHP last; } location~. PHP $ { fastcgi _ pass 127.0.0.133609000; fastcgi_index index.php; fastcgi _ param script _ filename $ document _ root $ fastcgi _ script _ name; 包括fastcgi _ params; }