XF 1.4 VB4 Redirects not Working - on phones or tablets

Bonsai Coder

Active member
Fresh install of xenForo and an import of data from vBulletin 4.x into a virgin xenForo database using all the old vBulletin thread ID's.

Redirects (thread links) in old content was taking me to the old vBulletin install.

So I added this code to .htaccess in the root:

Code:
RewriteEngine On

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

It fixed the problem for desktop access. But I am still having the problem in Android and tablet. Any thoughts?
 
Edit - it turns out it does NOT work on my PC.

All the links are still going to the old vBulletin install, instead of going to the new xenForo install.
 
Last edited:
Thanks Brogan.

With the old site now in a _archive folder, I am getting this result from the link:

Error.
The requested forum could not be found.

So the code I added to the .htaccess file is clearly not working.
 
I uploaded the scripts into my root directory.

I edited the 301config file with my values:

Code:
<?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/bonsainu/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', 'import_log_my_forums');

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

define('IMPORT_LOG_TABLE', 'archived_import_log');

Sadly, it is not working...

Bonsai Nut - Error
The requested forum could not be found.
 
You need to place the redirect scripts in the position where they cover the old URLs. Based on what you gave, that would be the forums directory not the root.

However, doing that might interfere with the forums path that XenForo uses by default. A workaround would be to change the name of that path with route filters. Alternatively, you could use rewrites to implicitly redirect the specific "plain" URLs to the files in the root.
 
You need to place the redirect scripts in the position where they cover the old URLs. Based on what you gave, that would be the forums directory not the root.

However, doing that might interfere with the forums path that XenForo uses by default. A workaround would be to change the name of that path with route filters. Alternatively, you could use rewrites to implicitly redirect the specific "plain" URLs to the files in the root.

Thanks again Brogan and Mike! I recreated the forums directory, moved the scripts there, and everything works fine! I had to disable friendly URL's (because of the /forums conflict), but otherwise the site isn't showing any hiccups.
 
Last edited:
Back
Top Bottom