nginx 301
Nginx实现301跳转
以下示例实现非xxx测试数据域名访问一律301跳转到xxx测试数据
if ($host != 'xxx测试数据') {
rewrite ^/(.*)$ http://xxx测试数据/$1 permanent;
}
使用permanent,发送301永久定向,对搜索引擎更加友好
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did44179