Resource icon

Redirection Scripts for vBulletin 3.x 8.0

No permission to download
@Adam Bloch

Add these rules to the top of the .htaccess file in your old /vb directory:

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /xf/index.php?threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/([0-9]+)-.+\.html$ /xf/index.php?threads/$1/ [R=301,L]

That should take care of both page links and non page links.
 
We are preparing to convert from vB 3.8.7 to XF 1.3. We plan on installing XF in the root directory and moving the vB forum to the directory /oldvb (for reference purposes only, with the directory being password blocked). Will this affect setting up redirect scripts?
 
We are preparing to convert from vB 3.8.7 to XF 1.3. We plan on installing XF in the root directory and moving the vB forum to the directory /oldvb (for reference purposes only, with the directory being password blocked). Will this affect setting up redirect scripts?
It should not affect them at all.
 
I ended up adding the following to the .htaccess

Code:
Redirect /payments.php http://forum.site.com/account/upgrades
 
You could also just stick a file called payments.php in your forum root with this code:
PHP:
<?php header('Location: http://forum.site.com/account/upgrades'); ?>
 
@UserMatt posted something about this in another section of the forum.

We're having a problem with this. When someone clicks on a Google search, instead of being taken to the thread, they're taken to the main forum page.

Google: emtlife stethoscopes
 
@0ptima

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

    #    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>
 
If you're being redirected to the forum index, it usually means that the 301config.php file isn't setup correctly -- make sure the correct import log table is set there.
 
Are you sure you're pointing at the correct import log table? I would guess the xf_import_log table is empty and that you archived the import log (to archived_import_log?).
 
Hello, I am really lost with this, I imported the forum without many problems, however this redirection I am finding very difficult.
VB forum was running VBSeo, however I did disable that before import ( I don't know if that would change anything)

VB Forum was www.site.net/forums ( But has since been renamed to forumold)

XF Forums in the root.

www.site.net

I have placed the HTAccess file with the following at the top as advised:

RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

I have uploaded the 301 redirect script to the VBulletin directory which is now called forumsold

at www.site.net/forumsold

as follows:

#
# $fileDir = '/home/example/public_html/new_forums';
#
# $fileDir = 'C:/inetpub/wwwroot/xenforo';
#
\* ----------------------------------------------------------- */

$fileDir = '/home/www.site.net/public_html';

/* ----------------------------------------------------------- *\
This constant defines the table from which the import redirection
scripts will fetch their data. Normally they will use the table
'xf_import_log', but if you have archived your import data, you
should provide the name of the archive table here. Remove the
leading // and then replace 'import_log_x' with the name of your
archive table, as in the following examples:
#
# define('IMPORT_LOG_TABLE', 'my_import_log');
#
# define('IMPORT_LOG_TABLE', 'archived_import_log');
#
\* ----------------------------------------------------------- */

define('IMPORT_LOG_TABLE', 'archived_import_log');

__________________

Old VB Link example:

http://www.site.net/forums/introductions-welcomes/105399-hello.html

New XF same link:

http://www.site.net/index.php?threads/hello.105399/

I am not having any luck with any links, nothing will redirect.

When clicking on the old link from google, I get the following error message
Not Found
The requested URL /forums/index.php was not found on this server.

Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.3.28 Server at


I am wondering what I have done wrong, Would it have anything to do with renaming the VBforum to Forumold? Many thanks for help,
 
Last edited:
Is this recommended over just putting in the htaccess rewrite rules? I assume this because it will adapt to what the xenforo settings are? How does google handle this addon?
 
@Adam Bloch

Add these rules to the top of the .htaccess file in your old /vb directory:

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-.+-([0-9]+)\.html$ /xf/index.php?threads/$1/page-$2 [R=301,L]
RewriteRule ^[^/]+/([0-9]+)-.+\.html$ /xf/index.php?threads/$1/ [R=301,L]

That should take care of both page links and non page links.

Hi Jake thanks for that... We have gone live and the redirects don't seem to quite work...

www.audi-sport.net/vb/17-a3-s3-forum-8l-chassis/

Many thanks

Adam
 
Is this recommended over just putting in the htaccess rewrite rules? I assume this because it will adapt to what the xenforo settings are? How does google handle this addon?

If the source and destination ids are the same then you can get away with just rewrite rules. There isn't really a benefit to using these redirect scripts over rewrite rules. However, the scripts are required if the source and destination ids are not the same (the scripts do the id mapping).
 
Hello, I am really lost with this, I imported the forum without many problems, however this redirection I am finding very difficult.
VB forum was running VBSeo, however I did disable that before import ( I don't know if that would change anything)

VB Forum was www.site.net/forums ( But has since been renamed to forumold)

XF Forums in the root.

www.site.net

I have placed the HTAccess file with the following at the top as advised:

RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]

I have uploaded the 301 redirect script to the VBulletin directory which is now called forumsold

at www.site.net/forumsold

as follows:

#
# $fileDir = '/home/example/public_html/new_forums';
#
# $fileDir = 'C:/inetpub/wwwroot/xenforo';
#
\* ----------------------------------------------------------- */

$fileDir = '/home/www.site.net/public_html';

/* ----------------------------------------------------------- *\
This constant defines the table from which the import redirection
scripts will fetch their data. Normally they will use the table
'xf_import_log', but if you have archived your import data, you
should provide the name of the archive table here. Remove the
leading // and then replace 'import_log_x' with the name of your
archive table, as in the following examples:
#
# define('IMPORT_LOG_TABLE', 'my_import_log');
#
# define('IMPORT_LOG_TABLE', 'archived_import_log');
#
\* ----------------------------------------------------------- */

define('IMPORT_LOG_TABLE', 'archived_import_log');

__________________

Old VB Link example:

http://www.site.net/forums/introductions-welcomes/105399-hello.html

New XF same link:

http://www.site.net/index.php?threads/hello.105399/

I am not having any luck with any links, nothing will redirect.

When clicking on the old link from google, I get the following error message
Not Found
The requested URL /forums/index.php was not found on this server.

Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.3.28 Server at


I am wondering what I have done wrong, Would it have anything to do with renaming the VBforum to Forumold? Many thanks for help,

I replied to your PM:

Add these rules to the top of the .htaccess file in your old /forums directory:

Code:
RewriteEngine On

RewriteRule ^[^/]+/([0-9]+)-[^\./]+\.html$ /index.php?threads/$1/ [R=301,L]

Or if you removed the old /forums directory then add this to the top of the .htaccess file in the web root:

Code:
RewriteEngine On

RewriteRule ^forums/[^/]+/([0-9]+)-[^\./]+\.html$ /index.php?threads/$1/ [R=301,L]
 
Top Bottom