How to redirect to a query

sjark nginx-forum at nginx.us
Wed Mar 9 13:50:33 MSK 2011


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




More information about the nginx mailing list