Welcome! Log In Create A New Profile

Advanced

Re: Regex rewrite to root document

January 16, 2012 05:00AM
On Sun, Jan 15, 2012 at 11:35:44PM -0500, etrader wrote:
> I have a simple re-write of
>
> rewrite ^/(.*) /post.php?id=$1 last;
>
> This will breaks my main index page, as domain.com will also be
> redirected to "post.php?id="

location = / {
...
}

location ~ ^/(?<ID>.+)$ {
fastcgi_pass ...
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/post/php;
fastcgi_param QUERY_STRING id=$id;
}


--
Igor Sysoev

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

Regex rewrite to root document

etrader January 15, 2012 11:35PM

Re: Regex rewrite to root document

António P. P. Almeida January 16, 2012 12:00AM

Re: Regex rewrite to root document

Igor Sysoev January 16, 2012 05:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 121
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