Welcome! Log In Create A New Profile


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

it is re-written to

this time the problem is: the url showing in address bar is changing.
What I want is: user should still see
in address bar, (after pressing enter/page loads) but it should process
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:


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
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: 102
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready