vBulletin

Discussion forums started blooming in the 2000s and a lot of popular web applications have appeared, such as vBulletin, phpBB, or InVision Board. Most of these forum software platforms have jumped on the bandwagon and now boast full SEO-friendly URL support. Unfortunately, rewrite rules often come in the form of .htaccess files. Indeed, the vBulletin developers have chosen to provide rewrite rules for Apache 2 and IIS, unsurprisingly forgetting Nginx. Let's teach them a lesson. The following table describes a solution for converting their Apache rewrite rules to Nginx:

Apache rule

Nginx rule

RewriteEngine on

Not necessary.

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

Do not rewrite if the requested URI corresponds to an existing file, folder, or link on the system.if (-e $request_filename) { break; }.

RewriteRule ^threads/.* showthread.php [QSA]

rewrite ^/threads/.*$ /showthread.php last;

RewriteRule ^forums/.* forumdisplay.php [QSA]

rewrite ^/forums/.*$ /forumdisplay.php last;

RewriteRule ^members/.* member.php [QSA]

rewrite ^/members/.*$ /members.php last;

RewriteRule ^blogs/.* blog.php [QSA]

rewrite ^/blogs/.*$ /blog.php last;

ReWriteRule ^entries/.* entry.php [QSA]

rewrite ^/entries/.*$ /entry.php last;

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

For some reason, the same set of rules appears twice in the .htaccess file provided by vBulletin. You do not need to insert the Nginx equivalent a second time.

RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]

rewrite ^/(?:(.*?)(?:/|$))(.*|$)$ /$1.php?r=$2 last;

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.105.87