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

XF 1.5 Rewrite rules for migration

#1
Hey guys Im a little confused on how to use proper rewrite rules.

As you can see I kept the IDs, so Im planning to redirect :

from this VB URL:
http://domain.com/showthread.php?t=30438

to this xenforo URL:
http://domain.com/threads/transform-and-opinion.30438/

from this VB URL:
http://domain.com/forumdisplay.php?f=218

to this xenforo URL:
http://domain.com/forums/new-users.218/

From this VB URL:
http://domain.com/member.php?u=4199

to this xenforo URL:
http://domain.com/members/john.4199/

Are these rewrite rules correct?

Code:
RewriteEngine On

RewriteRule ^/forum\.php$ /forums/ [R=301,L]

RewriteRule ^/forumdisplay\.php/([0-9]+)-.*$ /forums/$1/ [R=301,L]

RewriteRule ^/member\.php/([0-9]+)-.*$ /members/$1/ [R=301,L]

RewriteRule ^/showthread\.php/([0-9]+)-.*$ /threads/$1/ [R=301,L]
Thanks for the help!
 
#3
As far as I understand I only need to add rewrite rules because I have the same IDs, according to this post: https://xenforo.com/community/threads/vbulletin-4-x-url-redirection.26935/page-3#post-625763

Im sorry, Am I missing something ?

In case that I install the redirection scripts, I understand that I need to install them in the old vb folder, for example:
home/public_html/vb_forum
not
home/public_html/xenforo

After the installation has finished, can I erase the whole home/public_html/vb_forum folder and the database associated with vb?

Thanks for the help.
 
Last edited:

Jake Bunce

XenForo moderator
Staff member
#4
Yes, rewrites could work too since the ids are the same. But since your vB URLs are straight PHP links it is easier to just upload the PHP redirect scripts. To use those scripts your old vB folder needs to remain, but you can delete the vB files and leave only the redirect scripts. The vB database can also be removed.
 
#5
Actually I have too many folders and files in the old VB folder , (more than 10Gb) so I think that I wouldn't know exactly what VB files I need to delete to save disk space and make the redirection scripts work properly at the same time.
So should I delete every single folder and file after the installation but the redirect scripts ? I'm confused and I don't want to have any problems after the migration.

Also if I want to use the rewrite rules , can I use these lines or the ones that I posted above?

Code:
RewriteCond %{QUERY_STRING} ^t=([\d]+)
RewriteRule ^forumdisplay\.php /forums/%1/? [NC,L,R=301]
RewriteRule ^showthread\.php /threads/%1/? [NC,L,R=301]
RewriteRule ^member\.php /members/%1/? [NC,L,R=301]
RewriteRule ^forum\.php /forums/%1/? [NC,L,R=301]
Thank you very much for the help!
 
Last edited:

Mike

XenForo developer
Staff member
#6
To be clear, no old files or data are needed for the redirection scripts to work. You just need to drop them into the old location and (if necessary) adjust 301config.php to point to your XenForo files. They use only the XenForo database.