rewrite

Igor Sysoev is at rambler-co.ru
Wed Mar 26 15:40:44 MSK 2008


On Wed, Mar 26, 2008 at 02:32:53PM +0200, Yordan Georgiev wrote:

> Result: http://www.domain.tld/index.php?page=/test
> Desire: http://www.domein.tld/index.php?page=test

-         rewrite  ^(.*)/$ /index.php?page=$1;
+         rewrite  ^/?(.*)/$ /index.php?page=$1;

> On Wed, Mar 26, 2008 at 2:07 PM, Igor Sysoev <is at rambler-co.ru> wrote:
> 
> > On Wed, Mar 26, 2008 at 01:15:45PM +0200, Yordan Georgiev wrote:
> >
> > > 1. How should I proceed "RewriteRule ^(.*)\/$ index.php?page=$1",
> > because
> > > when I replace this rule with
> > > if ($host ~* "www.domain.tld" ) {
> > > rewrite ^/([^/]+)/ /index.php?page=$1;
> > > break;
> > > }
> > > But my directory in the root folder does not work. How should I set this
> > > rule correctly
> >
> >       server {
> >          server_name  www.domain.tld;
> >
> >          rewrite  ^(.*)/$ /index.php?page=$1;
> >
> >           ...
> >      }


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





More information about the nginx mailing list