• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Rewrite rule help. Change of domain

woei

Well-known member
#1
Hi.

I'm wondering how I make the correct rewrite rule for vBulletin 4.2.2. with advanced friendly urls enabled to XenForo.

Example old url:
http://forum.scooterforum.net/forum/showthread.php/203220-Sportstuur-toegelaten

Example new url (domain changed from forum.scooterforum.net to scooterforum.net)
http://scooterforum.net/threads/sportstuur-toegelaten.203220/

What do I need for successful rewriting of the urls? And more important, where do I need to put the .htacces file? Only in the forum.scooterforum.net root right? There would be the only place the rewrite is needed?
 

Jake Bunce

XenForo moderator
Staff member
#2
Add these rules to the top of the .htaccess file in forum.scooterforum.net/forum:

Code:
RewriteEngine On

RewriteRule ^showthread\.php/([0-9]+)-.*$ http://scooterforum.net/threads/$1/ [R=301,L]
 

woei

Well-known member
#3
Thanks. With my rewrite script below I don't need to upload the vb4 rewrite script right?

And is this correct code for rewriting everything that I need for vb 4? threads/posts/forums/attachments/archive/member/ links?
Code:
RewriteEngine On

RewriteRule archive/index\.php/t-([0-9]+)\.html$ http://scooterforum.net/threads/$1 [R=301,L]
RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)(&|$)
RewriteRule attachment\.php$ http://scooterforum.net/attachments/%1? [R=301,L]
RewriteCond %{QUERY_STRING} f=([0-9]+)(&|$)
RewriteRule forumdisplay\.php$ http://scooterforum.net/forums/%1? [R=301,L]
RewriteCond %{QUERY_STRING} u=([0-9]+)(&|$)
RewriteRule member\.php$ http://scooterforum.net/members/%1? [R=301,L]
RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
RewriteRule printthread\.php$ http://scooterforum.net/threads/%1? [R=301,L]
RewriteCond %{QUERY_STRING} p=([0-9]+)(&|$)
RewriteRule showpost\.php$ http://scooterforum.net/posts/%1? [R=301,L]
RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
 

Jake Bunce

XenForo moderator
Staff member
#4
Thanks. With my rewrite script below I don't need to upload the vb4 rewrite script right?

And is this correct code for rewriting everything that I need for vb 4? threads/posts/forums/attachments/archive/member/ links?
Code:
RewriteEngine On

RewriteRule archive/index\.php/t-([0-9]+)\.html$ http://scooterforum.net/threads/$1 [R=301,L]
RewriteCond %{QUERY_STRING} attachmentid=([0-9]+)(&|$)
RewriteRule attachment\.php$ http://scooterforum.net/attachments/%1? [R=301,L]
RewriteCond %{QUERY_STRING} f=([0-9]+)(&|$)
RewriteRule forumdisplay\.php$ http://scooterforum.net/forums/%1? [R=301,L]
RewriteCond %{QUERY_STRING} u=([0-9]+)(&|$)
RewriteRule member\.php$ http://scooterforum.net/members/%1? [R=301,L]
RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
RewriteRule printthread\.php$ http://scooterforum.net/threads/%1? [R=301,L]
RewriteCond %{QUERY_STRING} p=([0-9]+)(&|$)
RewriteRule showpost\.php$ http://scooterforum.net/posts/%1? [R=301,L]
RewriteCond %{QUERY_STRING} t=([0-9]+)(&|$)
Looks good to me. Those rules will handle the default non-friendly URLs (e.g. forumdisplay.php?f=#)