Welcome! Log In Create A New Profile

Advanced

Re: Redirect a user based in country and querystring value

April 01, 2011 02:22AM
On Thu, Mar 31, 2011 at 06:06:39PM -0400, nfn wrote:
> 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?

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 Sysoev
http://sysoev.ru/en/

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

Redirect a user based in country and querystring value

nfn March 31, 2011 06:06PM

Re: Redirect a user based in country and querystring value

nfn March 31, 2011 06:10PM

Re: Redirect a user based in country and querystring value

Igor Sysoev April 01, 2011 02:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready