Welcome! Log In Create A New Profile

Advanced

Re: change rewrite for nginx

August 06, 2009 04:58AM
On Thu, Aug 06, 2009 at 02:44:13PM +0700, Edho P Arief wrote:

> On Thu, Aug 6, 2009 at 8:05 AM, Big Bet<lists@ruby-forum.com> wrote:
> > RewriteCond %{REQUEST_FILENAME} !-f
> > RewriteCond %{REQUEST_FILENAME} !-d
> > RewriteRule . plus.php [L]
> >
> > how to change it for nginx ?
> > help me
>
> probably something like this
>
> try_files $uri @plus;
>
> location @plus
> {
> fastcgi_param SCRIPT_FILENAME $document_root/plus.php;
> ....
> ....
> }

The first way is the best. The lazy way is

try_files $uri /plus.php;

If you need to test directory too, then add "$uri/":

try_files $uri $uri/ @plus;

> or if you're feeling lazy
>
> error_page 404 = /plus.php;
>
> this probably works, too
>
> try_files $uri /plus.php;
>
> or this
>
> try_files $uri @plus;
>
> location @plus {
> rewrite ^.* /plus.php;
> }
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

change rewrite for nginx

Big Bet August 05, 2009 09:05PM

Re: change rewrite for nginx

edogawaconan August 06, 2009 03:44AM

Re: change rewrite for nginx

Igor Sysoev August 06, 2009 04:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 149
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready