Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
404 / 301 after import redirect on import ids Details »»
404 / 301 after import redirect on import ids
Version: 1.00, by Jerry Jerry is offline
Developer Last Online: Oct 2010 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.9 Rating:
Released: 04-22-2008 Last Update: Never Installs: 52
Re-useable Code  
No support by the author.

After importing from a source board there will be internal and external links that point to the old URLS.

During the import the origional import id's are kept (for one import) so a redirect can be calculated to find the new user/forum/thread/post, by looking up the old import{$type}id.

ImpEx currently alters the table to add the import id, though a planned future version will have this separated so multi-import sites can be managed,

The original discussion thread on vBulletin.com :

http://www.vbulletin.com/forum/showthread.php?t=178161

It is advised that $do_404 = false; is set so the 301 is sent with the new URL to update search engines.

The script needs setting up and customising to each site as the domains and URLs can be different.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 03-20-2010, 10:36 PM
pitrow pitrow is offline
 
Join Date: Jan 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #73  
Old 04-13-2010, 09:26 PM
pitrow pitrow is offline
 
Join Date: Jan 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #74  
Old 04-14-2010, 04:57 PM
napy8gen napy8gen is offline
 
Join Date: Jan 2006
Location: port ++++son
Posts: 519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #75  
Old 04-15-2010, 08:14 PM
adeel80 adeel80 is offline
 
Join Date: Apr 2010
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by napy8gen View Post
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.
Reply With Quote
  #76  
Old 08-24-2010, 01:49 AM
CRDeveloper's Avatar
CRDeveloper CRDeveloper is offline
 
Join Date: Aug 2009
Location: Costa Rica
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!!

I've upgrade a phpBB 3.0.7 forum to vBulletin 4.0.6 PL1 successfully. Redirects working fine!!!
Reply With Quote
  #77  
Old 08-28-2010, 11:43 AM
BrightStar's Avatar
BrightStar BrightStar is offline
 
Join Date: Nov 2008
Location: UK
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ToxXxicas View Post
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.
Reply With Quote
  #78  
Old 02-05-2011, 03:15 PM
traen traen is offline
 
Join Date: Oct 2009
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with several types of old forums at once, or are you limited to using one at a time?
Reply With Quote
  #79  
Old 02-09-2011, 05:38 PM
futurist futurist is offline
 
Join Date: Feb 2011
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Regards
Reply With Quote
  #80  
Old 06-13-2011, 07:25 AM
MarpeX MarpeX is offline
 
Join Date: Dec 2009
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lazydesis View Post
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?
Reply With Quote
  #81  
Old 10-25-2011, 06:41 PM
licensinglinks licensinglinks is offline
 
Join Date: Sep 2011
Posts: 56
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 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.17597 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (16)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete