Thread: Miscellaneous Hacks - phpBB2 Thread URL Redirection Script
View Single Post
  #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
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02111 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete