Advertisement:

Author Topic: Redirect PHP-Fusion URLs to SMF2 URLs ?  (Read 3306 times)

Offline phantomm

  • Sophist Member
  • *****
  • Posts: 1,063
  • Gender: Male
    • pages/smfpl/171860759503032 on Facebook
    • Polish ElkArte community
Redirect PHP-Fusion URLs to SMF2 URLs ?
« on: January 18, 2011, 07:50:01 AM »
Hi, i don't know if i write this message on right board, but this is question related to conversion - PHP-Fusion to SMF2 RC4

There is way to redirect old urls from PHP-Fusion ( example.com/forum/viewthread.php?forum_id=6&thread_id=1256 ) to new in SMF ( example.com/index.php?topic=1256.0 ) ?

I think that's possible by adding rewrite rules to htaccess - maybe someone got that code and could share here ?
Polskie wsparcie SMF na simplemachines.org

My mods

ThorstenE

  • Guest
Re: Redirect PHP-Fusion URLs to SMF2 URLs ?
« Reply #1 on: January 18, 2011, 09:23:21 AM »
I'd use php files instead, simply create a file named viewthread.php and place it in your old PHP-Fusion directory.:
Code: (viewthread.php) [Select]
<?php
//change URL
$location 'http://www.yourdomain.com/index.php';

// do not change anything below this line...
if (isset($_GET['thread_id']))
{
$_GET['thread_id'] = (int) $_GET['thread_id'];
$redirect 'Location: ' $location '?topic=' .  $_GET['thread_id''.0';
//now the redirect
header('HTTP/1.1 301 Moved Permanently'); 
header($redirect);
}
else
{
$redirect 'Location: ' $location;
//now the redirect
header('HTTP/1.1 301 Moved Permanently'); 
header($redirect);
}
?>
$location should be replaced with your URL.