Advertisement:

Author Topic: IPB -> SMF old links handling  (Read 9059 times)

Offline octopus22

  • Semi-Newbie
  • *
  • Posts: 41
IPB -> SMF old links handling
« 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

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,905
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: IPB -> SMF old links handling
« Reply #1 on: December 08, 2005, 10:27:54 AM »
index.php

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

Add after that
Code: [Select]
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
Cincy Space - now open!

Offline octopus22

  • Semi-Newbie
  • *
  • Posts: 41
Re: IPB -> SMF old links handling
« Reply #2 on: December 08, 2005, 01:29:49 PM »
code works with '.' instead of ','

and no any result... http://osravers.com/index.php?showtopic=6471

Offline tempster

  • Semi-Newbie
  • *
  • Posts: 31
Re: IPB -> SMF old links handling
« Reply #3 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?