现在有这个需求
http://www.example.com/aboutus/?age=33&hl=zh
跳转到
http://www.example.com.cn/aboutus/?age=33
,
http://www.example.com.cn/aboutus/?age=33&hl=en
跳转到
http://www.example.com/aboutus/?age=33
目前的代码是这样的:
if ($query_string ~ "^(.*)hl=en$"){
rewrite ^(.*) http://www.enfsolar.com.cn$1$2 permanent;
}
这样设置后,第一个url跳转到http://www.example.com.cn/aboutus/?age=33&hl=zh, 需要怎样修改,可以把后面的hl=zh去掉。
另外,如果需要判断域名,怎么改。
http://www.example.com/aboutus/?age=33&hl=zh
跳转到
http://www.example.com.cn/aboutus/?age=33
,
http://www.example.com.cn/aboutus/?age=33&hl=en
跳转到
http://www.example.com/aboutus/?age=33
目前的代码是这样的:
if ($query_string ~ "^(.*)hl=en$"){
rewrite ^(.*) http://www.enfsolar.com.cn$1$2 permanent;
}
这样设置后,第一个url跳转到http://www.example.com.cn/aboutus/?age=33&hl=zh, 需要怎样修改,可以把后面的hl=zh去掉。
另外,如果需要判断域名,怎么改。