IPB -> SMF old links handling

Started by octopus22, December 06, 2005, 12:09:43 PM

Previous topic - Next topic

octopus22

old IPB has links like this:
index.php?showtopic=6971

and after convert SMF create links:
index.php/topic,6971.0.html
or
index.php?topic=9148.0

how can i handle old links?
if i want just to redirect from "showtopic=" to "topic="

thanks for advise

Oldiesmann

index.php

Find
elseif (empty($_REQUEST['action']))
{


Add after that
if(isset($_REQUEST['showtopic']))
{
$location = (!empty($modSettings['queryless_urls'])) ? '/topic,', $_REQUEST['showtopic'], '.0.html' : '?topic=', $_REQUEST['showtopic'], '.0';

header('HTTP/1.1 301 Moved Permanently');
header('Location: ', $scripturl . $location);
}


The 301 Moved Permanently header is to tell search engines that the old URL should be updated with the new URL.
Michael Eshom
Christian Metal Fans

octopus22


tempster

anyone have any new tips on how to preserve (or redirect) old ipb urls after converting to smf to avoid disruption to search engine listings and rankings?

Advertisement: