Welcome! Log In Create A New Profile

Advanced

Re: Redirect ends up in a loop

June 30, 2010 04:24AM
On Wed, Jun 30, 2010 at 03:45:27AM -0400, shainp wrote:

> Hello!
>
> I wanted to use NginxHttpMapModule and NginxRedirect to redirect static
> links to dynamic php links.
>
> I want to redirect http://my_domain/static/static_page1.html to
> http://domain_name/dynamic/zone.php?zoneid=86 by looking up the url from
> a map table.
>
> I tried this but it ends in a redirect loop.
>
> [code]
> map_hash_bucket_size 256;
> map $uri $dynamic_url {
> default 42;
> /static/static_page1.html 86;
> /static/static_page2.html 36;
> }
> server {
> listen 80;
> server_name _;
> rewrite ^
> http://domain_name/dynamic/zone.php?zoneid=$dynamic_url break;
> }
> [/code]

Do you want to proxy or redirect ?

- rewrite ^ http://domain_name/dynamic/zone.php?zoneid=$dynamic_url break;
+ rewrite ^ http://domain_name/dynamic/zone.php?zoneid=$dynamic_url;


--
Igor Sysoev
http://sysoev.ru/en/

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

Redirect ends up in a loop

shainp June 30, 2010 03:45AM

Re: Redirect ends up in a loop

Igor Sysoev June 30, 2010 04:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 268
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready