Resource icon

Redirection Script for phpBB 3.2/3.3+ (without SEO URLs) htaccess 1.0

No permission to download
Compatible XF 2.x versions
2.0, 2.1
Additional requirements
Apache htaccess
License
Creative Commons license
This script is based on different htaccess rules posted on xenforo forums and my own editing.

Requirements:

This script assumes you have friendly urls enabled for Xenforo.

What it will do

"/viewforum.php?f=X" will redirect to "/forums/X/" and
"/viewtopic.php?t=X" will redirect to "/threads/X/" and
"/viewtopic.php?p=X" will redirect to "/posts/X/".
"/memberlist.php?mode=viewprofile&u=X" will redirect to "/members/X/".

If you have /threads/title.x/ type of urls for xenforo, there might a second redirect by xenforo itself where it would redirect from threads/x/ to threads/title.x/

Installation
Insert this in your .htaccess file preferably BEFORE or ABOVE Xenforo friendly url redirect ( RewriteRule ^.*$ index.php [NC,L])


Apache config:
        RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$) [NC]
        RewriteRule ^viewtopic\.php$ /threads/%2/? [L,R=301,NC]
        RewriteCond %{QUERY_STRING} f=(\d+)$ [NC]
        RewriteRule ^(viewforum\.php|viewtopic\.php)$ /forums/%1/? [L,R=301,NC]
        RewriteCond %{QUERY_STRING} (^|&)p=([0-9]+)(&|$) [NC]
        RewriteRule ^viewtopic\.php$ /posts/%2/? [L,R=301,NC]
        RewriteCond %{QUERY_STRING} u=(\d+)$ [NC]
        RewriteRule ^memberlist\.php$ /members/%1/? [L,R=301,NC]
Done. That's all there is to it

If your forum is installed at say /forums/ then add /forums/ before the redirect in above script for example /threads/%2/? will be /forums/threads/%2/?
Author
STNN
Downloads
8
Views
184
First release
Last update
Rating
0.00 star(s) 0 ratings
Top