Welcome! Log In Create A New Profile

Advanced

Re: nginx rewrite help

September 27, 2010 11:14AM
in fact, URI should not contain /mybb/
in php handling part, it is re-written to be /mybb/$1
to let php find that file in dir /mybb/


with my tests, I came to this point:

if I add this on top of conf:

location ~ \.html$ {
rewrite ^/forum-([0-9]+)\.html$ /forumdisplay.php?fid=$1;
rewrite ^/Forum-([0-9]+)\.html$ /forumdisplay.php?fid=$1;
}


when I write
http://destek.10tl.net/forum-40.html
or
http://destek.10tl.net/Forum-40.html

it is re-written to
http://destek.10tl.net/forumdisplay.php?fid=40

but,
this time the problem is: the url showing in address bar is changing.
What I want is: user should still see
http://destek.10tl.net/forum-40.html
in address bar, (after pressing enter/page loads) but it should process
http://destek.10tl.net/forumdisplay.php?fid=40
in background.

this is done in apache rewrite like this. and I (and my users) wants this way.

can I achive this ?

here is a sample, similar site with apache running:
http://webboss.10tl.net/forum-48.html

thanks.


On Mon, Sep 27, 2010 at 4:59 PM, Ensiferous <nginx-forum@nginx.us> wrote:
> Hi,
>
> The rewrite you use contains /mybb/ but the URI does not. Rewrites work
> on the URI and not the file path, so unless the information provided is
> not accurate this is probably why your rewrite does not match.
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,134553,134565#msg-134565
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

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

nginx rewrite help

bvidinli September 27, 2010 09:42AM

Re: nginx rewrite help

Ensiferous September 27, 2010 09:59AM

Re: nginx rewrite help

bvidinli September 27, 2010 11:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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