2011年3月9日星期三

Re: How to redirect to a query

Thanks that works! one more question

can I do something like this if $host = 'one.mysite.com' and $arg_index
= "" then it should go to one.mysite.com/?index=site&id=1 if
two.mysite.com it go to two.mysite.com/?index=site&id=2

Tryed to replayed AND with & or && but it just give me a error
"configuration file /etc/nginx/nginx.conf test failed"
and I am not allowed todo a if inside of a if
[code]
location = / {
if ($host = 'one.mysite.com' AND $arg_index = "") {rewrite ^
?index=site&id=1 permanent;}
if ($host = 'two.mysite.com' AND $arg_index = "") {rewrite ^
?index=site&id=2 permanent;}
}
[/code]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,181278,181550#msg-181550


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论