Page 1 of 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... LastLast
Results 1 to 15 of 248
Like Tree1Likes

404 / 301 Tool After Import Redirect on ImpEx imported forums

This is a discussion on 404 / 301 Tool After Import Redirect on ImpEx imported forums within the General Discussion forums, part of the vBSEO SEO Plugin category; One of vBulletin's biggest advantages is Impex. ImpEx is a tool which allows you to easily import content from most ...

  1. #1
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4

    404 / 301 Tool After Import Redirect on ImpEx imported forums

    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:

    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});
    ?>
    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:
    $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     ''
    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:

    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

    Code:
    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]
    IPB 2 Users
    Code:
    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]
    MyBB 1.2 / 1.4

    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]
    Download:

    http://www.vbseo.com/attachments/f83...s-vbseo301.zip
    Last edited by Andrés Durán Hewitt; 05-05-2011 at 11:04 PM.
    ALP likes this.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  2. #2
    Senior Member Array
    Real Name
    dave
    Join Date
    Jun 2006
    Posts
    348
    Liked
    0 times
    Blog Entries
    1
    Quote Originally Posted by Mert Gökçeimam View Post

    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]

    This is awesome, My client is going to be thrilled for this as he was not wanting to convert due to not being able to redirect all the URL's efficently, hopefully he converts all his phpBB sites over to vBulletin and vBSEO now.

    I'm going to go install phpBB and then import it to vBulletin and test this out and see how it works. This just made my day
    Last edited by FightRice; 10-17-2008 at 02:41 PM.

  3. #3
    Senior Member Array
    Real Name
    Johnny5
    Join Date
    Oct 2008
    Posts
    231
    Liked
    1 times
    Thanks so much, Mert! It's working perfectly on my board and I plan to use it on another board I am converting soon.

  4. #4
    Senior Member Array
    Real Name
    Marco Mamdouh
    Join Date
    May 2008
    Location
    Egypt
    Posts
    2,627
    Liked
    3 times
    Blog Entries
    1
    Excellent Information mert thanks.

  5. #5
    Junior Member Array
    Real Name
    Jordi
    Join Date
    Dec 2008
    Posts
    7
    Liked
    0 times
    With this script the old phpBB URLs will be redirected twice? the first one performed by vbseo301.phpscript and the second one performed by vBSEO?

  6. #6
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    Hello Jordi ,

    The script will redirect old phpbb links to showthread and forumdisplay pages and vBSEO will rewrite them. Unfortunately there is no other way to do this.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  7. #7
    Senior Member Array
    Real Name
    Joseph Ward
    Join Date
    Jun 2005
    Posts
    23,845
    Liked
    44 times
    Blog Entries
    9
    However, when using the vBSEO sitemap as well Jordi, you will find that the update gets accelerated.

  8. #8
    Junior Member Array
    Real Name
    Jordi
    Join Date
    Dec 2008
    Posts
    7
    Liked
    0 times
    Quote Originally Posted by Mert Gökçeimam View Post
    Hello Jordi ,

    The script will redirect old phpbb links to showthread and forumdisplay pages and vBSEO will rewrite them. Unfortunately there is no other way to do this.
    With vBSEO Functions for Extensibility can't be done?

  9. #9
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    Unfortunately no. In order to achieve correct redirection you need have the above setup. I also fail to understand what worries you that much.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  10. #10
    Junior Member Array
    Real Name
    Thealpha
    Join Date
    Apr 2007
    Posts
    28
    Liked
    0 times
    I recently merged 2 vbulletin forums both of which had vbseo installed. Is there a way to properly redirect the old urls?

  11. #11
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    Unfortunately no , because .htaccess rules will conflict with your existing installation.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  12. #12
    Junior Member Array
    Real Name
    brandon
    Join Date
    Feb 2009
    Posts
    11
    Liked
    0 times
    I tried this (did it all correctly) but get the following errors when visiting one of my old smf url's

    Code:
    Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /my/absolute/path/vbseo301.php on line 2
    
    Parse error: syntax error, unexpected T_STRING in /my/absolute/path/vbseo301.php on line 2

  13. #13
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    You donot have a vBSEO license asigned to your username. If you purchased vBSEO please supply me your purchase id and forum adress via PM so i can correct your license.
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

  14. #14
    Junior Member Array
    Real Name
    Ahmed
    Join Date
    Feb 2009
    Posts
    4
    Liked
    0 times
    Thanks so much for the information .

  15. #15
    Member Array
    Real Name
    Dascrow
    Join Date
    Mar 2007
    Location
    Alamogordo, NM
    Posts
    39
    Liked
    1 times
    What is the difference between this and the 404.php included with Impex?

Page 1 of 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... LastLast

Similar Threads

  1. Replies: 4
    Last Post: 04-08-2008, 06:03 AM
  2. RC8 - CSS redirect for Moderator forums
    By skoenig in forum Bug Reporting
    Replies: 2
    Last Post: 01-23-2007, 08:43 PM
  3. 301 Redirect on Forums
    By tavenger5 in forum Custom Rewrite Rules
    Replies: 8
    Last Post: 05-23-2006, 10:46 PM
  4. The use of Impex to import a board
    By roadart in forum General Discussion
    Replies: 1
    Last Post: 05-13-2006, 07:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •