XF 1.4 vbulletin4 to xenforo import redirect help

hello i've done my test import with now issues, i'm just having a bit of a problem with the redirects, i'm using: https://xenforo.com/community/resources/vbulletin-4-x-url-redirection.120/

my vb forums url is: www.vbdomain.com/forums

but to avoid the forums/forums in the url i'm installing xenforo in the root as it just looks wrong(unless there's another way to avoid forums/forums in the url )

the vb forum use the default url structure www.vbdomain.com/forums/showthread.php?t=1234 and the new xenforo install will use mod_rewrite friendly urls

When trying the vb formated "forums/showthread.php?t=1234" part of the url on a local xf install: localhost/forums/showthread.php?t=1234 i get "The requested forum could not be found."

if i remove the "forums" from the url it works, there's probably a simple answer to this but can't see it.

Can anyone help?


XenForo developer
Staff member
The problem is that for the original redirects to work, you need to create a forums/ directory and you need to put the redirects in that directory so that they are accessible at the original URL. However, creating a forums/ directory may interfere with XenForo handling URLs like forums/forum-name.123/ correctly. I would recommend trying it to see if it interferes. If it does, the simplest approach may be to use a route filter to change "forums" to something else. Alternatively, you may be able to a rewrite to change forums/showthread.php to actually access /showthread.php and allow the forums/ directory to be removed.

Jake Bunce

XenForo moderator
Staff member
If you want to remove the /forums directory but still maintain redirects then add these rules to the top of your .htaccess file in the web root:

RewriteEngine On

RewriteRule ^forums/showthread\.php$ /showthread.php [R=301,L]
That will allow your redirects scripts to reside in the web root.

If you need the other scripts (not just showthread.php) then use this:

RewriteEngine On

RewriteRule ^forums/(attachment|forumdisplay|member|printthread|showpost|showthread)\.php$ /$1.php [R=301,L]

Mr Lucky

Well-known member
I have tried both of the above and I get this error:

An unexpected database error occurred. Please try again later.

It is correctly stripping the /forums/ but still shows the old vb URL


Can anyone help please?


XenForo developer
Staff member
View the source of the page and it will show you a more specific error. I suspect that you haven't specified the correct import log table though.

Mr Lucky

Well-known member
Thanks, that appears to be the case.

<!-- Mysqli prepare error: Table 'lug_xen_132.archived_import_log' doesn't exist -->
How do I find the correct import log table?



XenForo developer
Staff member
If you chose to archive the data, it's the name of the table you entered (it defaults to archived_import_log). If you didn't archive it, the data is still in xf_import_log. (If you don't get an error but redirects don't work, the incorrect table has been specified.) If neither of those work, you'll need to look at the table list in something like phpMyAdmin to identify what you called it.

Mr Lucky

Well-known member

phpmyadmin shows that there is the default xf_import_log

However when I enter that in 301config.php, all redirects go to the home page instead of the corresponding new xenforo URL.


XenForo developer
Staff member
That table will always exist. Is it empty? (If not, what sort of data is in it?) If so, you may need to look through the list closely to see if you can find the log table. If you can't find one, have you attempted multiple imports?

Mr Lucky

Well-known member
Is it empty? (If not, what sort of data is in it?)
No, e.g.:

SQL result

Host: localhost
Database: lug_xen_132
Generation Time: Jun 12, 2015 at 02:11 PM
Generated by: phpMyAdmin / MySQL 5.6.23
SQL query: SELECT * FROM `xf_import_log` LIMIT 0, 30 ;
Rows: 30
content_type     old_id     new_id    
attachment     10     10
attachment     100     100
attachment     101     101
attachment     102     102
attachment     103     103
attachment     104     104
attachment     106     106
attachment     107     107
attachment     108     108
attachment     109     109
attachment     11     11
attachment     110     110
attachment     111     111
attachment     112     112
attachment     113     113
attachment     114     114
attachment     115     115
attachment     116     116
attachment     117     117
attachment     118     118
attachment     119     119
attachment     121     121
attachment     122     122
attachment     124     124
attachment     125     125
attachment     126     126
attachment     127     127
attachment     128     128
attachment     129     129
attachment     130     130


XenForo developer
Staff member
Can you confirm that there are "thread" entries in that table? Getting redirected to the home page generally indicates that the import log table didn't contain a record for that entry. (Be careful when testing as your browser may cache the redirect; it's worth checking with different (known-valid) IDs.)