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

XF 1.2 vB4 to Xenforo Redirect

Carla Birch

Well-known member
#1
Need a bit of help setting up the redirect of vb4 to Xenforo, i used to have this working but now google webmaster tools is showing a lot of errors, I'm guessing at some stage i edited something and broke it doh.

Both the normal vb4 and vbseo url are showing up in the google tools

Old vb4 URL: http://www.yourpshome.net/showthread.php?t=3316
Old vbSEO URL: http://www.yourpshome.net/f8/your-game-merch-collections-3316/
New Xenforo URL: http://www.yourpshome.net/threads/your-game-merch-collections.3316/

I still have my archived_import_log table also and i see the data for that above eg there still.

my htaccess is:
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

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

    <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 /

        #    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) - [NC,L]
        RewriteRule (robots\.txt)$ robots.php [NC,L]
        RewriteRule ^.*$ index.php [NC,L]

    </IfModule>
my 301config.php
PHP:
<?php

/* ----------------------------------------------------------- *\
This variable defines where XenForo is installed.

If you have not installed XenForo into the same directory in which
vBulletin was installed, you will need to provide the full path to
the XenForo directory here. Remove the leading // and then enter
the path as in the following examples:

    $fileDir = '/home/example/public_html/new_forums';

    $fileDir = 'C:/inetpub/wwwroot/xenforo';

\* ----------------------------------------------------------- */

//    $fileDir = '/home/username/www/forums';

/* ----------------------------------------------------------- *\
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', 'import_log_my_forums');

\* ----------------------------------------------------------- */

    define('IMPORT_LOG_TABLE', 'archived_import_log');
My server is now using nginx btw also. Any help is more than welcome.
 

Jake Bunce

XenForo moderator
Staff member
#3
It all looks correct to me... for an Apache server.

nginx != htaccess

For nginx the rewrites must be converted and added to your server config.
 

Carla Birch

Well-known member
#4
It all looks correct to me... for an Apache server.

nginx != htaccess

For nginx the rewrites must be converted and added to your server config.
Any ideas on how to do that jake? I thinked if htaccess did now work then Xenforo Full Friendly URLs would not work, yet they working :s
 

Jake Bunce

XenForo moderator
Staff member
#7
You already have the correct rule for that:

Code:
RewriteRule f[\d]+/.+-([\d]+)/ showthread.php?t=$1 [NC,L]
Or I find sometimes it's necessary to specify the range and not use \d:

Code:
RewriteRule f[0-9]+/.+-([0-9]+)/ showthread.php?t=$1 [NC,L]
And maybe specify the full web path for the target:

Code:
RewriteRule f[0-9]+/.+-([0-9]+)/ /showthread.php?t=$1 [NC,L]
Or just skip the redirect scripts since the ids are the same:

Code:
RewriteRule f[0-9]+/.+-([0-9]+)/ /threads/$1/ [R=301,L]