Simple Machines Community Forum

SMF Support => Converting to SMF => IPB => Topic started by: octopus22 on December 06, 2005, 12:09:43 PM

Title: IPB -> SMF old links handling
Post by: octopus22 on December 06, 2005, 12:09:43 PM
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
Title: Re: IPB -> SMF old links handling
Post by: Oldiesmann on December 08, 2005, 10:27:54 AM
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.
Title: Re: IPB -> SMF old links handling
Post by: octopus22 on December 08, 2005, 01:29:49 PM
code works with '.' instead of ','

and no any result... http://osravers.com/index.php?showtopic=6471
Title: Re: IPB -> SMF old links handling
Post by: tempster on April 23, 2011, 11:42:37 AM
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?