• 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?

#1
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:

Code:
www.domain.com/forum/threads/12345-Thread-Title
On the new forum, they look like this:

Code:
forum.domain.com/threads/Thread-Title.12345/
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
#2
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):

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
#5
I was wondering if this script could be modified to handle a change in directory as well? Example:

Old VB URL:
http://www.website.com/showthread.php?204648-Some-kind-of-title&p=4113254

Redirecting to the new URL:
http://www.website.com/community/index.php?threads/Some-kind-of-title.204648
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.