Thread: Miscellaneous Hacks - 404 / 301 after import redirect on import ids
View Single Post
  #31  
Old 09-08-2008, 10:38 PM
tommythejoat's Avatar
tommythejoat tommythejoat is offline
 
Join Date: Apr 2008
Location: Boston
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have been working on this for a different source system than yours, but I may be able to offer a couple of tips.

1. You need to be able to parse off the old id code for anything you want to serve on redirect.

Your forum and thread links appear to be exactly the same and neither has an identifier, so I don't think those will do you any good. Perhaps you copied the wrong thing.

2. The 404 trap program needs to find the code from the old reference that was translated to an equivalent code in the vBulletin system.

In your case this looks like either the numeric part of the topic .html file name or the message number in that file. In either case if you can find a unique string that ALWAYS preceded the critical identifier, you can use the php intval function to return that number as show in the examples in Jerry's 404 program.

The number or numbers you get by this technique need to be the ones that ImpEx previously deposited in the ImportID column of the Thread, Forum or Post table.

When you have these numbers you can use them in mySQL queries to find out what the equivalent number is in vBulletin.

If you have never done any programming in PHP or any other language, you probably have little chance of accomplishing any of this. If you have had some basic programming experience, you should be able to follow it with a fair bit of work.

Once the 404.php program is built to do the translation trick, you need to use .htaccess to call the program when your web site would have reported a 404 File not Found error. The .htaccess file needs to be in the directory that is trying to display the missing file.

Quote:
ErrorDocument 404 /trap404.php

php_flag log_errors on
php_value error_log /var/www/html/php_error.log
This is the file I am using. I found it convenient to turn on php error reporting as well as using the ErrorDocument directive to turn on the trap.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01326 seconds
  • Memory Usage 1,766KB
  • 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
  • (1)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