PDA

View Full Version : Redirect SMF index.php?topic* to a single 404 page


v.bampton
12-08-2010, 06:27 PM
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 (https://vborg.vbsupport.ru/showthread.php?t=176964) 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
# Using QUERY_STRING

$queryString = $_SERVER['QUERY_STRING'];

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