Vanilla forum – Simple way to get friendly URL(URLs rewriting) work in Nginx

[Software] Vanilla forum – Simple way to get friendly URL(URLs rewriting) work in Nginx

I am not sure if it’s a good decision yet to build a forum in Geekologie, since I am not getting too much traffic to the site. I did it anyway.

After spending a lot of time on the LowEndTalk forum, where I am actively involving on the VPS/dedicated server discussions, I decided to try Vanilla forum. Installation is simple, just as all other blog/forum php software. But when I open the dashboard, oh woo, is it too simple? I can hardly find any useful settings.

Anyway, I need to get the URL rewriting work first. URL rewriting translate URL such as:
http://www.geekologie.net/forum/index?p=categories
to
http://www.geekologie.net/forum/categories
which looks more user friendly and also SEO friendly.

There are tons of articles on how to setup Vanilla forum URL rewriting in Nginx, but they are too complicated. Actually, if you have a working PHP+Nginx environment. It’s quite easy:

  1. put the following configuration in your Nginx vhost or global setting:
 location /forum
 {
 try_files $uri $uri/ @forum;
 }
 location @forum
 {
 rewrite ^/forum(.+)$ /forum/index.php?p=$1 last;
 }

This assumes you have the forum installed in /forum directory. Modify it if necessary.
2. Modify /forum/conf/config.php, change “RewriteUrls” setting from “False” to “True”.

That’s it, enjoy beautiful URLs.

Leave a Comment

This post is created on April 12, 2015