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

XF 1.4 vBulletin import - redirecting URLs?

Discussion in 'Troubleshooting and Problems' started by compactabt, Mar 14, 2015.

  1. compactabt

    compactabt Member

    I've just imported a vBulletin forum to XenForo.

    Moving forward, this new forum's going to exist in a subdomain, whereas before it was in a /forum folder.

    On my old forum, URLs look like this:

    On the new forum, they look like this:

    The (apparently very effective) unofficial plugin doesn't seem to have done the job. Should there be special instructions for a subdomain?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    In your example the ids are the same so you don't need those PHP redirect scripts. You can use pure rewrites.

    I assume the old and new URLs (with and without the subdomain) have the same web root.

    To handle the subdomain redirection and the vB -> XF redirects, add these rules to the top of the .htaccess file in your /forum directory (where vB was and XF is):

    RewriteEngine On
    #change to subdomain
    RewriteCond %{HTTP_HOST} !^forum\.domain\.com$
    RewriteRule ^(.*)$ http://forum.domain.com/$1 [R=301,L]
    #make exception for XF's thread URLs just in case
    RewriteRule ^threads/[^\./]+\.[0-9]+/ - [S=1]
    #then redirect vB's thread URLs
    RewriteRule ^threads/([0-9]+)-.*$ /threads/$1/ [R=301,L]
    #vB index
    RewriteRule ^forum\.php$ / [R=301,L]
    #make exception for XF's member URLs just in case
    RewriteRule ^members/[^\./]+\.[0-9]+/ - [S=1]
    #then redirect vB's member URLs
    RewriteRule ^members/([0-9]+)-.*$ /members/$1/ [R=301,L]
    #make exception for XF's forum URLs just in case
    RewriteRule ^forums/[^\./]+\.[0-9]+/ - [S=1]
    #then redirect vB's forum URLs
    RewriteRule ^forums/([0-9]+)-.*$ /forums/$1/ [R=301,L]
  3. compactabt

    compactabt Member

    Jake you are amazing. Thanks so much, this worked perfectly!
  4. misterburke_

    misterburke_ New Member

  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Those PHP redirect scripts come with a 301config.php file. That file has a setting to specify the path to XenForo. So basically upload the PHP redirect scripts to the old vB location, edit 301config.php file specify the path to XenForo, and it will automatically perform the redirect and the change of directory.

Share This Page