1. 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

Discussion in 'Installation, Upgrade, and Import Support' started by ChrisW, Dec 27, 2013.

  1. ChrisW

    ChrisW Member

    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: Dec 27, 2013
  2. Liam W

    Liam W Well-Known Member

    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
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

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

    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]
    
     
    Liam W likes this.
  4. CNK

    CNK Active Member

    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.. :(
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    @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]
    
     
    CNK likes this.
  6. CNK

    CNK Active Member

    Thx, it works great! :)
     

Share This Page