vBulletin 4.x URL Redirection

vBulletin 4.x URL Redirection 1.0.0

No permission to download
Ah sorry - i have no idea of these redirection scripts :(

Old vB4 structure was:
www.domain.com/forum/showthread.php?653-Unsere-Gipfelliste

New xF structure:
www.domain.com/forum/thema/unsere-gipfelliste.653/

Id's are the same .. xF installation folder was renamed to "forum" where vb4 was installed.

-----
Figured it out i think. The files of the Redirection Script Addon were uploaded to the wrong folder.

Another question: many of my vB4 CMS Articles are linked from other forums/pages. Is there a way to redirect these links to the existing forum threads?

Old vB4 CMS Article Url structure:
www.domain.com/forum/content.php?305-Von

New xF Thread Url:
www.domain.com/forum/thema/von.1768/
 
Last edited:
Ah sorry - i have no idea of these redirection scripts :(

Old vB4 structure was:
www.domain.com/forum/showthread.php?653-Unsere-Gipfelliste

New xF structure:
www.domain.com/forum/thema/unsere-gipfelliste.653/

Id's are the same .. xF installation folder was renamed to "forum" where vb4 was installed.

Thanks for your help :rolleyes:

Put these rules at the top of the .htaccess file in your /forum directory:

Code:
RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-
RewriteRule ^showthread\.php$ /forum/thema/%2/? [R=301,L]
 
I've got two problems with the redirect scripts.

The first one is a missing hyphen in the URL. For example:

showthread.php?48159-test&p=986570&viewfull=1#post986570

creates this link:

/threads/test.48159/#post986570

But correct would be

/threads/test.48159/#post-986570

And the other problem is the page. If a post is on the second site, the link just send me to the first page. The /page-2 is missing in the URL.

I hope there is a solution :) Thanks for the help and these great scripts!
 
I've got two problems with the redirect scripts.

The first one is a missing hyphen in the URL. For example:

showthread.php?48159-test&p=986570&viewfull=1#post986570

creates this link:

/threads/test.48159/#post986570

But correct would be

/threads/test.48159/#post-986570

And the other problem is the page. If a post is on the second site, the link just send me to the first page. The /page-2 is missing in the URL.

I hope there is a solution :) Thanks for the help and these great scripts!

Can you provide full before and after URLs of the same thread in both vB and XF? Then I can be sure about your redirects and provide exact instructions.
 

Add to the top of the .htaccess file in the web root for forum.scharesoft.de:

Rich (BB code):
RewriteEngine On

RewriteCond %{QUERY_STRING} &p=([0-9]+)(&|$)
RewriteRule ^showthread\.php$ http://www.newxfsite.com/posts/%1/? [R=301,L]

RewriteCond %{QUERY_STRING} (^|\?)([0-9]+)-
RewriteRule ^showthread\.php$ http://www.newxfsite.com/threads/%2/? [R=301,L]
 
Hello,

I am using NGINX now, previously using litespeed.

My old vB4.x URLs
http://www.1911addicts.com/showthread.php?9032-Second-Annual-Addicts-Shoot
My new XF URLs
http://1911addicts.com/threads/second-annual-addicts-shoot.9032/

It redirects to the homepage. I checked my 301config file.
I have these two tables in my database
import_log_1911 - the one I typed
xf_import_log

I've set it to both...no luck.

This is still a vB page:

http://www.1911addicts.com/showthread.php?9032-Second-Annual-Addicts-Shoot

It appears you didn't overwrite the showthread.php file with the new redirect script. Those redirect scripts need to be uploaded to your web root (where vB is/was).
 
I just imported the site, and changed it over today. You must be cached still.

Must be.

When it redirects a thread URL to the homepage that usually indicates an incorrect import_log table in your 301config.php file. You said you already tried naming all of your log tables. Maybe you forgot to uncomment the line? You need to remove the "//" at the beginning:

Code:
//	define('IMPORT_LOG_TABLE', 'import_log_x');
 
define('IMPORT_LOG_TABLE', 'import_log_1911');

I did edit the conf file, since htaccess doesn't work for nginx
Code:
 if ($query_string ~ "&p=([0-9]+)(&|$)"){
                rewrite ^/showthread\.php$ http://1911addicts.com/posts/%1/? redirect;
         }
        if ($query_string ~ "(^|\?)([0-9]+)-"){
          rewrite ^/showthread\.php$ http://1911addicts.com.com/threads/%2/? redirect;
             }
 
I have confirmed import_log_1911 has all the information in it.

Can we confirm what might be the nginx rules?

We shouldn't need to use nginx rules.

Try editing the showthread.php file. Add the red code:

Rich (BB code):
$input = $inputHandler->filter(array(
	't' => XenForo_Input::UINT,
	'p' => XenForo_Input::UINT
));
if(preg_match('/(?:showthread|printthread)\.php(?:\/|\?)([0-9]+)(?:-[^\/]+)/', $http->getRequestUri(), $matches) && count($matches) >= 1){    
	$input['t'] = intval($matches[1]);
}

echo $input['t'];
exit();

$importModel = XenForo_Model::create('XenForo_Model_Import');

Now when you visit a showthread.php URL it should display just the threadid number. I want to make sure that is the case. Maybe it's not correctly extracting the number from the URL. This debugging will tell us for sure.
 
It outputs a 0 when visiting an old thread.

Ok, so the script isn't correctly extracting the id from the URL.

If you give me FTP access to the server then I can debug this further and fix the script for you.

I should note that the debug successfully outputs the threadid on my Apache server.
 
Hello, im new at Xenforo! And this is my first problem:

My old forum vb4 url structure: www.domain.nl/forums/showthread.php?t=16111

my new xenforo url structure: http://forum.domain.nl/threads/nieuw-hier.17062/#post-339161

I used the vb4 redirection tool. But every domain on vbulletin redirects to the homepage of xenforo.

Can someone help me with this?

That will happen if the import_log table is wrong.

Confirm the name of your import_log in the database. It is usually one of these:

xf_import_log
archived_import_log


Then edit the 301config.php file to specify the name of that table.
 
Has anyone had any issues moving forum.php from vBulletin4 with a rewrite to index.php for xenforo?

Like for nginx I'm not sure where to put the rewrite?
location /forum {
rewrite ^/forum\.php$ / redirect;
}
 
Hello

I get it not to work.

vb
http://www.t5-board.de/board/forums/82-Das-T5-Board
xf
http://www.t5-board.de/#das-t5-board.82

vb
http://www.t5-board.de/board/forums/92-Ankündigungen-des-Teams
xf
http://t5-board.de/forums/ankuendigungen-des-teams.92/

vb
http://www.t5-board.de/board/threads/83852-Ein-Dankeschön
xf
http://t5-board.de/threads/ein-dankeschoen.83852/

vb
http://www.t5-board.de/board/threads/52961-T5-mit-Anhänger-Bilder/page2
xf
http://t5-board.de/threads/t5-mit-anhaenger-bilder.52961/page-2

vb
http://www.t5-board.de/board/members/34804-MarcusMüller
xf
http://t5-board.de/members/marcusmueller.34804/


The contents of the 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 = '/kunden/xxx_xxx/webseiten/vcom/site/board';

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

And the setting in the Administration.
Options: Basic Board Information | Admin CP - T5-Board 2014-02-22 13-53-48 2014-02-22 13-53-51.webp
 
Top Bottom