-1
我需要重定向只http://shop.test.com到http://www.test.com/fedex-orders/重定向仅首页
只是主页。没有其他的。即http://shop.test.com/?page=blog不应该重定向。
我需要重定向只http://shop.test.com到http://www.test.com/fedex-orders/重定向仅首页
只是主页。没有其他的。即http://shop.test.com/?page=blog不应该重定向。
添加位置信息,像这样:
location =/{
if ($args !~* .+) {
return 301 http://www.test.com/fedex-orders;
}
}
基本上该位置的“/”而已,所以任何配置匹配有只适用于网页
,因为与得到的参数什么是相同的文件对于Web服务器,你需要额外的if,只有当正则表达式不匹配时才重定向。