vBulletin 4.x URL Redirection

vBulletin 4.x URL Redirection 1.0.0

No permission to download
Got that reversed. It was caused by the .htaccess file I moved in web root. Everything's working fine again.
 
Yesterday,i used it.
But,I only use showthread,showpost,attach,member,..
And i didn't install addon_vb4Redri.xml.
It didn't work.It redirect all links to home page??

Click links: http://domain.com/showthread.php?id

Erorr.
It moved to home page : http://domain.com

Why??I must be doing something wrong.How do i edit 301config.php??

define('IMPORT_LOG_TABLE', 'archived_import_log');
 
Last edited:
Actually I never figured this out. Suppose my old forum installation is at http://www.domain.com/forums, and now on XF it's simply http://www.domain.com. Should the 301config.php file be on the root or under /forums?

It can go either way. If the redirect scripts are not in the XF root then you must edit the 301config.php file to specify the path.

If you are uncertain then please provide an example old and new URL for a thread on vB and the same thread in XF. Then I can provide exact instructions for your redirects.
 
OK, so I thought this would be straight forward but after reading this thread I'm worried. I just installed XenForo and have an existing vB install that I want to redirect.

vB 4.2 is installed at http://mysite.com/forums

XenForo is installed at http://mysite.com

I have installed XenPorta and changed the default page to be /portal, because of that I had to create a route filter and change forums/ to forum/ (because the "real" forums directory was being loaded)

So... How should I proceed? Can I remove the route filter and just remove the old vB install directory or do I need it to upload the redirect scripts?

I see mention of redirect scripts and .htaccess rewrite rules. Do I need both, or one or the other? The download for this resource has rewrite scripts and what looks like an add-on. Do I need both? I'm so confused!
 
So... How should I proceed? Can I remove the route filter and just remove the old vB install directory or do I need it to upload the redirect scripts?

Either way can work, with or without the vB directory. If you don't need the vB files for anything else then probably just remove that dir and setup rewrite rules in the web root.

I see mention of redirect scripts and .htaccess rewrite rules. Do I need both, or one or the other? The download for this resource has rewrite scripts and what looks like an add-on. Do I need both? I'm so confused!

Please provide example old and new thread URLs so I can provide exact instructions for you.
 
Not sure exactly how many you need but here are some examples:

Main forum page:
old vB - http://mysite.com/forums/forum.php
new XF - http://mysite.com/forums

forumdisplay:
old vB - http://mysite.com/forums/forumdisplay.php/2-Game-Chat
new XF - http://mysite.com/forums/game-chat.2/

Member Profile:
old vB - http://mysite.com/forums/member.php/40-VF21
new XF - http://mysite.com/members/vf21.40/

Showthread:
old vB - http://mysite.com/forums/showthread.php/53595-Trade-Chris
new XF - http://mysite.com/threads/trade-chris.53595/

I went ahead and removed the vB directory and removed the route filter so I'd like to place the rewrite stuff in my root folder. Please give as much detail as possible. File names, location, etc?

Also, do I still upload the files in this resource (301config.php, forumdisplay.php, etc) and if so do they now go in the XF root folder?

Thanks!
 
@Royals

The ids are the same so you don't need these scripts. Just place these rules at the top of the .htaccess in web root:

Code:
RewriteEngine On

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

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

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

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

Hmm. Try this to avoid any conflicts:

Rich (BB code):
#    Mod_security can interfere with uploading of content such as attachments. If you
#    cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#    SecFilterEngine Off
#    SecFilterScanPOST Off
#</IfModule>

ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^politicaljack\.com [NC]
    RewriteRule (.*) http://www.politicaljack.com/$1 [L,R=301]

    #make exception for XF's thread URL format
    RewriteRule ^threads/[^\.]+\.[0-9]+/ - [S=1]
    #redirect vB's thread URL format
    RewriteRule ^threads/([0-9]+)-.*$ /threads/$1? [R=301,L]

    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
</IfModule>
AuthName "xenForo Test Bed"
AuthUserFile "/home/politics/.htpasswds/public_html/xenforo/passwd"

That should work to avoid any conflicts with the redirects.
Jake I moved from vB 4 (with Full friendly URLs) to XF over the weekend. Getting redirects to work has been a bear. I got threads working with the code you provided in this thread

Code:
#make exception for XF's thread URL format
    RewriteRule ^threads/[^\.]+\.[0-9]+/ - [S=1]
    #redirect vB's thread URL format
    RewriteRule ^threads/([0-9]+)-.*$ /threads/$1? [R=301,L]

However members and forums aren't properly redirecting.

Examples:
http://ourdjtalk.com/members/1087-Ausumm should redirect to http://ourdjtalk.com/members/ausumm.1087/

Any ideas? Thanks.
 
@Big Dan

Code:
    #make exception for XF's member URL format
    RewriteRule ^members/[^\.]+\.[0-9]+/ - [S=1]
    #redirect vB's member URL format
    RewriteRule ^members/([0-9]+)-.*$ /members/$1? [R=301,L]
 
I've moved a vBulletin installation from root to another folder so I've set the following rules:
Code:
RewriteEngine On

RewriteRule ^threads/([0-9]+)-.*$ /f/threads/$1? [R=301,L]
RewriteRule ^forums/([0-9]+)-.*$ /f/forums/$1? [R=301,L]
RewriteRule ^members/([0-9]+)-.*$ /f/members/$1? [R=301,L]
 
I want to switch from VB / Apache to XF / Nginx.
Can I use your script for this?
The problem for me are the rewrite rules.

Currently I'm testing on a test forum with a different URL.
 
hi...


Old URL Tags Of Vbulletin. http://domain.com/tags.php?tag=......
New URLTags of Xenforo.
http://domain.com/tag/.....

I want to Redirect URL Tags when i converted from vbulletin to xenforo.

Help Me..
What do you recommend to avoid those 404 errors with tags?

I need help with a redirection:
Members:
Old vB: http://www.domain.com/foro/member.php?u=11
New xf: http://www.domain.com/members/user.11/

I tried this to modify this solution from @Jake Bunce but its not the same case:
Code:
RewriteRule ^forums/member\.php/([0-9]+)-.*$ /members/$1/ [R=301,L]

Tried several attemps like:
Code:
RewriteRule ^foro/member.php?u=$1 /members/$1/ [R=301,L]
or
Code:
RewriteRule ^foro/member\.php\?u=([0-9]+)$ /members/$1/ [R=301,L]

But doesn't work too, any help?
Thanks!

PS: also having problems with these ones:
Members:
Old vB: http://www.domain.com/foro/member.php?u=11
New xf: http://www.domain.com/members/user.11/

Showthread post:
Old: http://www.movilesdualsim.com/foro/showthread.php?p=355354
New: http://www.movilesdualsim.com/threads/Índice-de-tutoriales.33881/page-12#post-355354

Showthread:
Old: http://www.movilesdualsim.com/foro/...android-4-1-1-gb-ram-8-gb-rom-5-hd-ips-screen
New: http://www.movilesdualsim.com/threa...-4-1-1-gb-ram-8-gb-rom-5-hd-ips-screen.24576/

Showthread II:
Old: http://www.movilesdualsim.com/foro/showthread.php?t=45756
New: http://www.movilesdualsim.com/threads/tutorial-rootea-tu-móvil-en-un-minuto-sin-pc-ni-drivers.45756/

Forum (cathegory):
Old: http://www.movilesdualsim.com/foro/forums/79-Móviles-DualSIM
Redirects to: http://www.movilesdualsim.com/forums/79/
But should redirect to: http://www.movilesdualsim.com/#moviles-chinos-dualsim.79

Tags:
Old: movilesdualsim.com/foro/tags.php?tag=f006
New: don't kown what to do with them... to search results with the same tag? :p

Attachments:
Old 1: http://www.movilesdualsim.com/foro/attachment.php?attachmentid=12805&d=1364045156
Old 2: http://www.movilesdualsim.com/foro/attachment.php?attachmentid=15147
New: also don't know :(

Is there any way to say
if "foro/tags(anything else)" then "redirect to home"
 
Last edited:
@Breixo

For all of the old ".php" URLs I suggest using these scripts in the old /foro directory:

http://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/

Tags do not have an equivalent in XF. I suggest leaving those alone so they return 404 which is appropriate.

For the friendly thread URLs, add this to the top of the .htaccess file in the /foro directory:

Code:
RewriteEngine On

RewriteRule ^threads/([0-9]+)-.+$ /threads/$1/ [R=301,L]
 
Back
Top Bottom