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
phpBB2 Thread URL Redirection Script Details »»
phpBB2 Thread URL Redirection Script
Version: 1.01, by bbcentral bbcentral is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.7 Rating:
Released: 01-31-2007 Last Update: 06-19-2007 Installs: 23
Additional Files  
No support by the author.

This is a very simple script I wrote after I converted two forums from phpBB2 to vBulletin.

The problem was that there were dozens of pages across the web linking to particular phpBB2 threads, ie:
http://www.website.com/forum/viewtopic.php?t=1234

Of course now those links are dead, as the correct URL would be:
http://www.website.com/forum/showthread.php?t=2345

My simple script is just one single file that you upload to your forum root folder. It doesn't modify any code, doesn't require any installation, and zero configuration is required (it uses the includes/config.php to get the database settings.

If someone clicks on a link to viewtopic.php (either pointing to a thread or a post), then it will link to that same thread at showthread.php.

Installation Instructions
Upload viewtopic.php to your vBulletin root folder, eg /forum/

Working demo
Thread name "The Apogee Interview series and the weekly Prey update"
Old phpBB2 URL: http://www.bluesbrotherscentral.com/...pic.php?t=2374
New vB URL: http://www.bluesbrotherscentral.com/...ead.php?t=2190

Notes
  • Non existent threads will simply redirect to index.php
  • This file assumes that your vBulletin was installed to the same URL as your phpBB2 path, eg /forum/ rather than /phpbb/ and /vb/, or /forum/ and /newforum/
  • This will only work if your 'post' and 'thread' tables have values in the 'importpostid' and 'importthreadid' columns
Comments and suggestions welcome

Update
June 20, 2007 - Added changes suggested by 'propeller', now uses 301 redirect for search engines.

Show Your Support

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

Comments
  #12  
Old 03-10-2007, 11:14 PM
bbcentral's Avatar
bbcentral bbcentral is offline
 
Join Date: Apr 2006
Location: Australia
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Soliloquy View Post
This looks like exactly what I need! Except my old phpBB forum was in the /forum directory and the new vBulletin forum is in the root directory. Is there any way to change it?
Try this one:
Attachment 61703

Upload it into your /forum/ folder, it will include the vB files from the root directory and redirect there, it's customised just for your situation.
Reply With Quote
  #13  
Old 04-26-2007, 09:35 AM
nixcraft nixcraft is offline
 
Join Date: Apr 2007
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, this is an excellent script, i had something like this for my old blog you saved my time
Reply With Quote
  #14  
Old 05-07-2007, 11:00 AM
aam aam is offline
 
Join Date: Apr 2007
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does exactly as what it says on the packet. Nice.
Reply With Quote
  #15  
Old 05-07-2007, 12:01 PM
Luky Luky is offline
 
Join Date: Oct 2006
Location: Australia
Posts: 595
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good if you just SEO'ed
Reply With Quote
  #16  
Old 05-08-2007, 11:35 AM
Mrdby Mrdby is offline
 
Join Date: Mar 2007
Location: Hades
Posts: 1,298
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i need to see a demo
Reply With Quote
  #17  
Old 05-22-2007, 06:09 AM
propeller propeller is offline
 
Join Date: May 2007
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would set 301 redirects for the search engines.

header( "HTTP/1.1 301 Moved Permanently" );
header("Location: ".$redir);
exit();
Reply With Quote
  #18  
Old 05-23-2007, 04:24 AM
patch developer patch developer is offline
 
Join Date: May 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is something not clear for me , i had a phpBB2 forum which is reside in folder1 and i moved to VBulletin in another folder let us say folder2 , i imported all the data using Impex tool , so i want to confirm this viewtopic.php it should be copied in the old forum folder (folder1) ?
Reply With Quote
  #19  
Old 05-25-2007, 01:14 PM
maxicep maxicep is offline
 
Join Date: Oct 2006
Location: California
Posts: 288
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

do not working on my 3.66.
redirecting to forumhome page
Reply With Quote
  #20  
Old 05-27-2007, 12:54 AM
Riccardo83's Avatar
Riccardo83 Riccardo83 is offline
 
Join Date: May 2007
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is great, what about those who used mod_rewrite on phpBB2 ? SEO Mod

Meaning how do i get this url http://www.alizee-forum.com/topic,14063,.html redirected properly?

Meaning to get it to redirect to http://www.alizee-forum.com/viewtopic.php?t=14063 and ur script will then do redirect to http://www.alizee-forum.com/showthread.php?t=16946
Reply With Quote
  #21  
Old 06-20-2007, 08:04 AM
bbcentral's Avatar
bbcentral bbcentral is offline
 
Join Date: Apr 2006
Location: Australia
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mrdby View Post
i need to see a demo
There's a working demo in the main post, but I'll repost it here:
Working demo
Thread name "The Apogee Interview series and the weekly Prey update"
Old phpBB2 URL: http://www.bluesbrotherscentral.com/...pic.php?t=2374
New vB URL: http://www.bluesbrotherscentral.com/...ead.php?t=2190

Quote:
Originally Posted by propeller View Post
This would set 301 redirects for the search engines.
Thanks for that, I can't believe I didn't think of including that when I've used it everywhere else on my site! Added it into the code, released v1.01, and put your name in the credits

Quote:
Originally Posted by patch developer View Post
There is something not clear for me , i had a phpBB2 forum which is reside in folder1 and i moved to VBulletin in another folder let us say folder2 , i imported all the data using Impex tool , so i want to confirm this viewtopic.php it should be copied in the old forum folder (folder1) ?
Your old forum used to be in /folder1/viewtopic.php?t=1234
Your new forum is in /folder2/showthread.php?t=5678
What you're doing is replacing the original viewtopic.php page with my file. Now, you're going to need to modify the viewtopic.php code slightly so it includes the config.php file in folder2.
Line 16 should become:
Code:
include_once "../folder2/includes/config.php";
Line 60 should become:
Code:
header("Location: /folder2/".$redir);
I think that's all you need to do, but I haven't tested it.

Quote:
Originally Posted by maxicep View Post
do not working on my 3.66.
redirecting to forumhome page
If it can't get the topic ID or the post ID, then it redirects back to the homepage.
You need to make sure that when you ran Impex it kept all the importpostid and importthreadid values in the vb_thread and vb_post tables. Redirecting to the homepage is the failsafe for threads which have been deleted or invalid links.

Quote:
Originally Posted by Riccardo83 View Post
this is great, what about those who used mod_rewrite on phpBB2 ? SEO Mod

Meaning how do i get this url http://www.alizee-forum.com/topic,14063,.html redirected properly?

Meaning to get it to redirect to http://www.alizee-forum.com/viewtopic.php?t=14063 and ur script will then do redirect to http://www.alizee-forum.com/showthread.php?t=16946
You're going to have to find a way to do that yourself, I would think you could just copy whatever you were doing for phpBB2. If you used .htaccess, add the same thing to your current .htaccess file.
Just as a guess, maybe:
Code:
RewriteRule ^topic,([0-9]*),.html* /viewtopic.php?t=$1
(I genuinely have no idea if that will work, found the snippet on another site)
This should redirect back to /viewtopic.php, which will then check your vBulletin tables for the new Thread or Post ID, and do the redirect as normal.
It's 3 steps instead of 2, but not a huge problem
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 02:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.19245 seconds
  • Memory Usage 2,315KB
  • 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
  • (3)bbcode_code
  • (6)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
  • (2)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