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

XF 1.2 301 redirect help

#1
Hi I've just imported from vb4 with vbseo to xenforo and need some help with redirects of all our old thread URLS.

My old vbseo URLs look like -

Code:
http://www.mobileexpert.co.uk/forums/real-true-tone-ringtones-mp3-wav-and-amr-ect/49572-lily-allen-somewhere-only-we-know-free-mp3-ringtone.html
New URL -

Code:
http://www.mobileexpert.co.uk/threads/lily-allen-somewhere-only-we-know-free-mp3-ringtone.49572
I notice that I can use http://www.mobileexpert.co.uk/threads/49572 so looks like we just need to take the thread id from all the old URLs and add to the new URL but not sure what the 301 redirect is to use ?

Thanks for your help.
 
Last edited:

Liam W

Well-known member
#2
You need to use the vBSEO script to convert vBSEO URL's back to vBulletin URL's, and then use the vBulletin redirect script to convert the vBulletin URL's to xenForo URL's.

Liam
 

Jake Bunce

XenForo moderator
Staff member
#3
You need to use the vBSEO script to convert vBSEO URL's back to vBulletin URL's, and then use the vBulletin redirect script to convert the vBulletin URL's to xenForo URL's.

Liam
Not necessary. You can rewrite directly since the ids are the same.

Hi I've just imported from vb4 with vbseo to xenforo and need some help with redirects of all our old thread URLS.

My old vbseo URLs look like -

Code:
http://www.mobileexpert.co.uk/forums/real-true-tone-ringtones-mp3-wav-and-amr-ect/49572-lily-allen-somewhere-only-we-know-free-mp3-ringtone.html
New URL -

Code:
http://www.mobileexpert.co.uk/threads/lily-allen-somewhere-only-we-know-free-mp3-ringtone.49572
I notice that I can use http://www.mobileexpert.co.uk/threads/49572 so looks like we just need to take the thread id from all the old URLs and add to the new URL but not sure what the 301 redirect is to use ?

Thanks for your help.
Does the /forums directory still exist? Or did you remove it?

I suggest removing (or renaming) the old /forums directory since it will conflict with XF's "forums" route. Then add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteRule ^forums/[^/]+/([0-9]+)-[^\.]+\.html$ /threads/$1/ [S=1]
 

CNK

Active member
#4
Can you help me with my links?

My new xF URL:
Code:
http://gsmx.co/58711/root-co-daje-co-nie.html
My old vB URL:
Code:
http://gsmx.co/threads/root-co-daje-a-co-nie.58711/

I tried add this to .htaccess:
Code:
    RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^([0-9]+)/(.+)$ /threads/$2.$1/ [L]
but it doesn't work.. :(
 

Jake Bunce

XenForo moderator
Staff member
#5
@CNK

Add these rules to the top of the .htaccess file in your web root:

Code:
RewriteEngine On

RewriteRule ^([0-9]+)/[^\.]+\.html$ /threads/$1/ [R=301,L]