vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Redirect SMF index.php?topic* to a single 404 page (https://vborg.vbsupport.ru/showthread.php?t=254884)

v.bampton 12-08-2010 06:27 PM

Redirect SMF index.php?topic* to a single 404 page
 
I've just upgraded from SMF to vBulletin 4.1.0 Suite, and most of it's working great but there's one thing I can't solve.

The old SMF links all look like /index.php?topic=11785

The new links don't tie up at all and the upgrade involved merging back in a couple of different databases, so there are no import id's left that I can find (yes, saw that script a bit too late!)

What I want to do is redirect all of those old SMF links to a single 404 page which explains why it's broken.

I wondered about an htaccess redirect, but whatever I do, any links which include index.php keeps redirecting back to forum.php.

What I am missing? Is there a vBulletin redirect that is overriding my attempts? Any help would be much appreciated!

Victoria

v.bampton 12-11-2010 10:59 AM

Just in case anyone else comes across this thread with the same problem, I found a workaround.

Add the following at the top of the index.php file (replacing the link with your own 404 page) and it redirects any threads with variables.

PHP Code:

<?php
# Using QUERY_STRING

$queryString $_SERVER['QUERY_STRING'];

if (
$queryString != null) { 
header("Location: http://www.yoursite.net/404.htm");
}
?>



All times are GMT. The time now is 06:24 AM.

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.01057 seconds
  • Memory Usage 1,713KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete