2011-12-26, 02:45 PM
Hello;
you will find here the way to redirect old phpbb links and pages and forums
Thanks to:
-frostschutz
-Dylan M.
this tutorial can have some bugs !!! so help us to fix and generalise it ...
before you do the merge you have to do somes modifications
in merge/index.php find and remove :
now you can converge ...
then create 2 files
viewtopic.php :
viewforum.php
viewtopic.php
this file get the old ids of the topics and convert them to the new ids of the same topics and create the final url
viewforum.php
same as topicredirect.php for forum instead of topics
and put the following code in you .htaccess
this .htaccess is for those who use phpbbseo with phpbb
Thank You !!
you will find here the way to redirect old phpbb links and pages and forums
Thanks to:
-frostschutz
-Dylan M.
this tutorial can have some bugs !!! so help us to fix and generalise it ...
before you do the merge you have to do somes modifications
in merge/index.php find and remove :
delete_import_fields();
now you can converge ...
then create 2 files
viewtopic.php :
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require("global.php");
// Did we get an old thread id?
if($mybb->input['t'])
{
// See if we can get a new one.
$import_tid = intval($mybb->input['t']);
$query = $db->simple_select("threads", "tid", "import_tid=${import_tid}");
$result = $db->fetch_array($query);
if($result)
{
// Redirect to the new thread URL...
header("Location: ${settings['bburl']}/".get_thread_link($result['tid']), true, 301);
exit;
}
}
// By default, redirect back to index.
header("Location: ${settings['bburl']}", true, 301);
exit;
?>
viewforum.php
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require("global.php");
// Did we get an old thread id?
if($mybb->input['f'])
{
// See if we can get a new one.
$import_fid = intval($mybb->input['f']);
$query = $db->simple_select("forums", "fid", "import_fid=${import_fid}");
$result = $db->fetch_array($query);
if($result)
{
// Redirect to the new thread URL...
header("Location: ${settings['bburl']}/".get_forum_link($result['fid']), true, 301);
exit;
}
}
// By default, redirect back to index.
header("Location: ${settings['bburl']}", true, 301);
exit;
?>
viewtopic.php
this file get the old ids of the topics and convert them to the new ids of the same topics and create the final url
viewforum.php
same as topicredirect.php for forum instead of topics
and put the following code in you .htaccess
RewriteEngine On
RewriteRule ^topic([0-9]+)\.html$ viewtopic.php?t=$1 [L]
RewriteRule .*\-f([0-9]+)\/.*\-t([0-9]+)\.html$ viewtopic.php?t=$2 [L]
RewriteRule .*\-f([0-9]+)\/$ viewforum.php?f=$1 [L]
this .htaccess is for those who use phpbbseo with phpbb
Thank You !!