XF 2.1 htaccess for phpbb to xenforo

stanleyb23

Member
Hey everybody!

I m migrating my old phpbb forum with seo urls to xenforo.
I ve searched for an htaccess file that will do the redirect but sofar i didnt find it.

Im looking for a script that will redirect like this:

Redirect all urls original phpbb forum to new xenforo urls

Thread urls:
/title-tTOPICID.html ---> /topic/title.TOPICID/
/title-tTOPICID-15.html ---> /topic/title.TOPICID/page-2
/title-tTOPICID-30.html ---> /topic/title.TOPICID/page-3

Forum urls
/title-fFORUMID.html ----> /forum/title.FORUMID/
/title-fFORUMID-50.html ----> /forum/title.FORUMID/page-2
/title-fFORUMID-100.html ----> /forum/title.FORUMID/page-3

Post urls
/postPOSTID.html /posts/POSTID/


Redirect all very old external links linking to the old urls where i didnt have the title in the url.

The links were like this:
/aboutTOPICID.html -----> /topic/title.TOPICID/
/viewtopic.php?t=TOPICID ---> /topic/title.TOPICID/
/viewforum.php?f=FORUMID ---> /forum/title.FORUMID/

Hopefully someone can give me some advise on this one!

Thanks Ralf
 
Add this code into the .htaccess file:
Code:
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]

Hope this help :)
 
Top Bottom