Welcome! Log In Create A New Profile

Advanced

nginx rewrite rules for bbPress showing ugly URLs in browser

Posted by rahul286 
nginx rewrite rules for bbPress showing ugly URLs in browser
March 24, 2010 10:15AM
Hey guys.

I just configured bbPress (once again) with nginx.

I am running into an issue as described below.

I have following lines in my nginx config with some other lines...

[code]
location / {
root /PATH/TO/rtforums.com;
index index.php index.html index.htm;

autoindex on;

if (!-e $request_filename) {
rewrite ^/topic/(.*)$ /topic.php?q=$1 last;
rewrite ^/forum/(.*)$ /forum.php?q=$1 last;
rewrite ^/profile/(.*)$ /profile.php?q=$1 last;
rewrite ^/view/(.*)$ /view.php?q=$1 last;
rewrite ^/tags/(.*)$ /tags.php?q=$1 last;
rewrite ^/rss/(.*)$ /rss.php?q=$1 last;
rewrite ^/bb-admin/ /bb-admin/index.php last;
rewrite ^/ /index.php last;
break;
}
}
[/code]

Now with respect to line....

[code]
rewrite ^/forum/(.*)$ /forum.php?q=$1 last;
[/code]

When I go to to http://rtforums.com/forum/buddypress-media-component
I get redirect to http://rtforums.com/forum/buddypress-media-component?q=buddypress-media-component

If u can notice there is unwanted part - "[b]?q=buddypress-media-component[/b]" being added.

In apache there is way to make URL rewrite internal. Is there anyway to achieve this in nginx?

Thanks for all the help in advance.
-Rahul

--
Rahul Bansal
EasyEngine - https://github.com/rtCamp/easyengine
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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