vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - 404 / 301 after import redirect on import ids (https://vborg.vbsupport.ru/showthread.php?t=176964)

pitrow 03-20-2010 10:36 PM

for those asking for phpbb3, this script will work for that with a few mods.

I successfully used it this weekend for a phpbb3 -> vb4 CMS swap. Works just fine.

pitrow 04-13-2010 09:26 PM

OK, here's what I did. Keep in mind it may not work for you, depending on your setup.

I was upgrading from phpbb 3.0.3 to vB CMS 4.0.

the old forum was on www.mydomain.com/forum.

The new CMS was installed in the root.

Most of the code works just fine, but here's exactly what I changed from the default 404.php you can download off of this page (as of today anyway).

change
Code:

$old_folder        = 'phpBB/';
to
Code:

$old_folder        = 'forum/';

change
Code:

$standard_404        = 'http://www.example.com/not_found.html';
to
Code:

$standard_404        = 'http://www.mydomain.com/404.shtml';
this points to my existing 404 file


change
Code:

$new_domain        = 'example';
to
Code:

$new_domain        = 'www.mydomain.com';

change
Code:

$new_folder                = 'vBulletin/';
to
Code:

$new_folder                = '';
notice I completely removed that string since I'm installing in the root.


changed the user, password and database variables to my particular values.


Inside
Code:

switch ($old_system)
{
        case 'phpBB2' :

change
Code:

$old_thread_script        = "viewtopic{$old_ext_type}?t=";
to
Code:

$old_thread_script        = "viewtopic{$old_ext_type}?f=";

inside
Code:

// It's for the old forum
if (strpos($_SERVER['REQUEST_URI'], "/{$old_folder}") === 0)
{
        switch ($old_system)
        {
                case 'phpBB2' :

find
Code:

$old_id = intval(substr(substr($_SERVER['REQUEST_URI'], 2), 0,  strpos(substr($_SERVER['REQUEST_URI'], 2), '&')));
now, I wasn't quite sure exactly what Jerry was doing with this code, so I just rewrote it so I'd know it would work. His might work just fine, but I didn't try it.


replace that line with:
Code:

$topic_loc = strpos($_SERVER['REQUEST_URI'],"&t=");
$end_loc = strpos($_SERVER['REQUEST_URI'],"&",$topic_loc+1);
if ($end_loc === FALSE)
{
        $old_id = substr($_SERVER['REQUEST_URI'],$topic_loc+3);
}
else
{
        $old_id = substr($_SERVER['REQUEST_URI'],$topic_loc+3, ($end_loc-($topic_loc+3)));
}


That's it.

I uploaded that to the root of my account, and made a .htaccess file with this line in it:
Code:

ErrorDocument 404 /404.php
I also deleted everything from the "forum" directory and uploaded an index.php file there that contains this:
Code:

<?PHP
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.mydomain.com/forum.php" );
?>

That way if someone tries to go to the old http://www.mydomain.com/forum, they get redirected to the new forum page, and if someone tries to get a forum or topic, the 404.php gets it and redirects them correctly.

napy8gen 04-14-2010 04:57 PM

I couldnt get the topic redirection right, only for members.

the example old link in google always in this format:
www.siasat.pk/forum/viewtopic.php?f=34&t=12541

I am using basic friendly urls, this is new vb4 features.

the url generated by it something like this. notice there is only topic number.
http://www.siasat.pk/forum/showthrea...ing-Blackwater.


any help Pitro would be great.

adeel80 04-15-2010 08:14 PM

Quote:

Originally Posted by napy8gen (Post 2021267)
I couldnt get the topic redirection right, only for members.

the example old link in google always in this format:
www.siasat.pk/forum/viewtopic.php?f=34&t=12541

I am using basic friendly urls, this is new vb4 features.

the url generated by it something like this. notice there is only topic number.
http://www.siasat.pk/forum/showthrea...ing-Blackwater.


any help Pitro would be great.

I am exactly having the same problem. Can someone please reply.

CRDeveloper 08-24-2010 01:49 AM

Thanks!!

I've upgrade a phpBB 3.0.7 forum to vBulletin 4.0.6 PL1 successfully. Redirects working fine!!!

BrightStar 08-28-2010 11:43 AM

Quote:

Originally Posted by ToxXxicas (Post 2088621)
Thanks!!

I've upgrade a phpBB 3.0.7 forum to vBulletin 4.0.6 PL1 successfully. Redirects working fine!!!

Could you please help me doing that as well?

I've upgraded from phpBB but it was with SEO Mod to vBulletin. Now struggling to understand what I am supposed to do.

traen 02-05-2011 03:15 PM

Does this work with several types of old forums at once, or are you limited to using one at a time?

futurist 02-09-2011 05:38 PM

No updates for SMF ?
I appreciate the work.
But including only a few boards is not good enough.

Regards

MarpeX 06-13-2011 07:25 AM

Quote:

Originally Posted by lazydesis (Post 1755441)
I imported from old vB to new version using Impex, and had the same problem. All threadIDs were different from what they were in my old forum, because I deleted some threads in between.

However instead of using the 404 method, I deleted the "threadid" column in my database and renamed the "importthreadid" column as "threadid"

Now all my threads are having same "threadid" as previous forum

Can anyone tell me if this has any adverse affects or what I did is wrong? Everything seems to working fine and it took me just 5 mins to do this.

What's the advantage of using the 404 method described in this thread?

Thanks.


EDIT: Its actually not working properly. Can someone tell me if its possible to change the new ids with the ones in the importids column and would this work ?

I have exactly the same question. My former board was a vB 4 from which I imported all the threads, posts and users to a news vB 3.8.6. Now the IDs in the URLs like http://www.domain.de/forum/category/1234-thread-title.html are not the same like in the old vB 4 board. What can I do?

licensinglinks 10-25-2011 06:41 PM

OK I'm in a bit of a panic. I just switched from phpBB3 to vBulletin and all my Google links have totally screwed up. This have resulted in traffic I've carefully built up for 2 years going off the edge of a cliff. I had no idea that this would happen!!!

Here's an example of a link that comes up in google to my old phpBB board.

PHP Code:

http://www.mechanicaldesignforum.com/forum/viewtopic.php?f=39&t=117 

However, since switching to vBulletin the new link has changed to:

PHP Code:

http://www.mechanicaldesignforum.com/forum/showthread.php?69-female-mechanical-designers 

Someone pointed me to this thread, but setting this solution up seems WAY beyond my abilities. I feel totally stuck.

Can anyone explain to me a step-by-step guide how to solve my problem. And please explain it to me like I'm 2 years old because I'm not joking - I really don't have a clue what to do and where to start.

I would really appreciate some help. I really need to get this fixed fast so my Google ranking doesn't get destroyed.


All times are GMT. The time now is 05:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01201 seconds
  • Memory Usage 1,760KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete