Redirect a user based in country and querystring value

Hello,

I’m looking for a way to redirect users from some countries and with a
querystring value to a specific page.

I tried this without success:

location /register.php {
if (($geoip_country_code = (BR|PT)) and ($arg_action = “register”)) {
rewrite ^(.*) /page/info/registo.html permanent;
}
}

How can I accomplish this?

Thanks

Posted at Nginx Forum:

I’m using 0.8.54-4ppa17~lucid full from

Posted at Nginx Forum:

On Thu, Mar 31, 2011 at 06:06:39PM -0400, nfn wrote:

}
}

How can I accomplish this?

In 0.9.6 you can use

map “$geoip_country_code.$arg_action” $registo {
default 0;
BR.register 1;
PT.register 1;
}

location = /register.php {
if ($registo) {
return 301 /page/info/registo.html;
}
}


Igor S.
http://sysoev.ru/en/