Redirect PHP-Fusion URLs to SMF2 URLs ?

Started by Adrek, January 18, 2011, 07:50:01 AM

Previous topic - Next topic

Adrek

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

the simplest solution is most likely the right one

ThorstenE

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.

Advertisement: