One of vBulletin's biggest advantages is Impex. ImpEx is a tool which allows you to easily import content from most of the other popular forum systems to vBulletin, allowing you to upgrade your forum software to vBulletin/vBSEO.
The downside of ImpEx was that if you had a single thread or post deleted, ImpEx could not keep the IDs same. This would have negative impact on the SEO for the site after transfer.
Fortunately, Jerry created a 404 script which grabs importedid from the database and correctly redirects to the new vBulletin ID. This is a great tool for imported boards. Since it is such an important feature, we requested Jerry's permission to modify his script and supply it to vBSEO owners. Jerry kindly gave us permission to do so.
The system currently supports phpBB, SMF, IPB 2 and MyBB
Note: If you have a board that is not listed here and you are interested in using this script after your Impex import, please supply us your example URLs so that we can prepare valid .htaccess redirect rules for you.
Please follow these instructions how to correctly redirect your old URLs to new versions.
You need to create vbseo301.php file with the following content:
You need to edit the file and make sure you have the correct database info for your vBulletin installation. The lines you need to edit are:PHP Code:<?php
/**
* 404 /301 for external and internal link redirect.
*
* @package ImpEx.tools
* @version $Revision: 1902 $
* @author Jerry Hutchings <jerry.hutchings@vbulletin.com>
* @modified by Oleg Ignatiuk
*/
$standard_404 = 'http://www.example.com/not_found.html'; // The usual 404 that this script replaces
$new_domain = 'example'; // Including domain extension such as www.example.com , donot include http://
$new_folder = 'vBulletin/'; // Put the trailing slash if you installed your forum in a folder, otherwise leave the option empty, without any slash or charatters between quotation marks
$ext_type = '.php'; // File extension type that vBulletin is using, i.e. index.php including the preceding dot
// Database
// This is the vBulletin database, needed for import id look up and logging
$server = 'localhost';
$user = 'user';
$password = 'password';
$database = 'forum';
$tableprefix = '';
$old_id = intval($_GET['oldid']);
$page = intval($_GET['page']);
$postcount = intval($_GET['postcount']);
$action = $_GET['action'];
$sql = null;
switch ($action)
{
case 'forum':
$sql = "SELECT forumid FROM {$tableprefix}forum WHERE importforumid={$old_id}";
$new_url = "http://{$new_domain}/{$new_folder}forumdisplay{$ext_type}?f=";
break;
case 'thread':
$sql = "SELECT threadid FROM {$tableprefix}thread WHERE importthreadid={$old_id}";
$new_url = "http://{$new_domain}/{$new_folder}showthread{$ext_type}?t=";
break;
case 'post':
$sql = "SELECT postid FROM {$tableprefix}post WHERE importpostid={$old_id}";
$new_url = "http://{$new_domain}/{$new_folder}showpost{$ext_type}?p=";
break;
case 'user':
$sql = "SELECT userid FROM {$tableprefix}user WHERE importuserid={$old_id}";
$new_url = "http://{$new_domain}/{$new_folder}member{$ext_type}?u=" ;
break;
}
if( $sql )
{
$link = @mysql_connect($server, $user, $password);
if ($link)
{
$db_selected = @mysql_select_db($database, $link);
if ($db_selected)
{
$result = @mysql_query($sql);
$row = @mysql_fetch_row($result);
if (!$row[0])
{
$action = 'Original data missing';
}
@mysql_free_result($result);
}
}
}
if (!$sql || !$old_id || !$row[0])
{
?>
<html>
<head>
<meta http-equiv="refresh" content="<?php echo $refresh_speed; ?>; URL=<?php echo $standard_404; ?>">
</head>
<body>
</body>
</html>
<?php
// Got nuffink
die;
}
$new_url .= $row[0];
if($page)
$new_url .= "&page={$page}";
if($postcount)
$new_url .= "&postcount={$postcount}";
@mysql_close($link);
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: {$new_url}" );
?>
Then you need to add the following rewrite rules to your .htaccess file just after the RewriteEngine On line. Please select the code based on the software you were running on your old forum:PHP Code:$standard_404 = 'http://www.example.com/not_found.html'; // The usual 404 that this script replaces
$new_domain = 'example';
$new_folder = 'vBulletin'; // Without trailing slash
$ext_type = '.php'; // File extension type that vBulletin is using, i.e. index.php including the preceding dot
// Database
// This is the vBulletin database, needed for import id look up and logging
$server = 'localhost';
$user = 'user';
$password = 'password';
$database = 'forum';
$tableprefix = '';
Phpbb Users
Code:RewriteCond %{QUERY_STRING} f=([0-9]+) RewriteRule viewforum\.php vbseo301.php?action=forum&oldid=%1 [L] RewriteCond %{QUERY_STRING} t=([0-9]+) RewriteRule viewtopic\.php vbseo301.php?action=thread&oldid=%1 [L] RewriteCond %{QUERY_STRING} ^p=([0-9]+) RewriteRule viewtopic\.php vbseo301.php?action=post&oldid=%1 [L] RewriteCond %{QUERY_STRING} u=([0-9]+) RewriteRule profile\.php vbseo301.php?action=user&oldid=%1 [L]
SMF Users
IPB 2 UsersCode:RewriteCond %{QUERY_STRING} board=([0-9]+) RewriteRule index\.php vbseo301.php?action=forum&oldid=%1 [L] RewriteCond %{QUERY_STRING} topic=([0-9]+) RewriteRule index\.php vbseo301.php?action=thread&oldid=%1 [L] RewriteCond %{QUERY_STRING} .msg([0-9]+) RewriteRule index\.php vbseo301.php?action=post&oldid=%1 [L] RewriteCond %{QUERY_STRING} action=profile;u=([0-9]+) RewriteRule index\.php vbseo301.php?action=user&oldid=%1 [L]
MyBB 1.2 / 1.4Code:RewriteCond %{QUERY_STRING} showforum=([0-9]+) RewriteRule index\.php vbseo301.php?action=forum&oldid=%1 [L] RewriteCond %{QUERY_STRING} showtopic=([0-9]+) RewriteRule index\.php vbseo301.php?action=thread&oldid=%1 [L] RewriteCond %{QUERY_STRING} view=findpost&p=([0-9]+) RewriteRule index\.php vbseo301.php?action=post&oldid=%1 [L] RewriteCond %{QUERY_STRING} showuser=([0-9]+) RewriteRule index\.php vbseo301.php?action=user&oldid=%1 [L]
Download:Code:RewriteCond %{QUERY_STRING} pid=([0-9]+) RewriteRule showthread\.php vbseo301.php?action=post&oldid=%1 [L] RewriteCond %{QUERY_STRING} tid=([0-9]+)\&page=([0-9]+) RewriteRule showthread\.php vbseo301.php?action=thread&oldid=%1&page=%2 [L] RewriteCond %{QUERY_STRING} tid=([0-9]+) RewriteRule showthread\.php vbseo301.php?action=thread&oldid=%1 [L] RewriteCond %{QUERY_STRING} fid=([0-9]+).*page=([0-9]+) RewriteRule forumdisplay\.php vbseo301.php?action=forum&oldid=%1&page=%2 [L] RewriteCond %{QUERY_STRING} fid=([0-9]+) RewriteRule forumdisplay\.php vbseo301.php?action=forum&oldid=%1 [L] RewriteCond %{QUERY_STRING} action=profile\&uid=([0-9]+) RewriteRule member\.php vbseo301.php?action=user&oldid=%1 [L]
http://www.vbseo.com/attachments/f83...s-vbseo301.zip


1Likes
LinkBack URL
About LinkBacks






Reply With Quote
