XF 1.4 vBulletin import - redirecting URLs?


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?

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):

Rich (BB code):
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]

Jake Bunce

XenForo moderator
Staff member
I was wondering if this script could be modified to handle a change in directory as well? Example:


Redirecting to the new URL:
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.