MyBB Community Forums
phpbb link conversion - Printable Version

+- MyBB Community Forums (
+-- Forum: Community Archive (
+--- Forum: Archived Forums (
+---- Forum: Archived Development and Support (
+----- Forum: MyBB 1.2 Series (
+------ Forum: MyBB 1.2 General Support (
+------ Thread: phpbb link conversion (/thread-14341.html)

Pages: 1 2

phpbb link conversion - talisman - 2006-12-05


i have a request (which may already have been filled)..

i have imported by phpbb into mybb however any links either within the forum or external to the forum still point to posts and threads using the phpbb url viewtopic, viewforum, viewthread etc obviously these will not be found because the urls have now become showthread, showpost etc etc.

I would like a php file in the root to interprate these requests and translate them into mybb urls and redirect.

I know that smf have these routing files available so it must be achievable (though not for me as i know nothing ).


RE: phpbb link conversion - Christian - 2006-12-06

Untested, but should work.

define("IN_MYBB", 1);
require_once "./global.php";
$fid = '1';
	$fid = intval($mybb->input['f']);
header("Location: ".$mybb->settings['bburl']."/forumdisplay.php?fid=".$fid);

define("IN_MYBB", 1);
require_once "./global.php";
$tid = '1';
	$tid = intval($mybb->input['t']);
header("Location: ".$mybb->settings['bburl']."/showthread.php?tid=".$tid);

RE: phpbb link conversion - talisman - 2006-12-06

thanks christian.. so create those two files and put them ion the root of the forum, yea ?

will this cover a direct post link as well ?


RE: phpbb link conversion - Christian - 2006-12-06

Correct, create the files and upload it to your server. What the code does is, all links going to viewforum.php?f=1. will forward to forumdisplay.php?fid=1 and viewtopic.php?t=1 forwards to showthread.php?tid=1.

Also, I forgot the HTTP status code, add the following before the other header's in the previous codes.
header('HTTP/1.1 301 Moved Permanently');

RE: phpbb link conversion - talisman - 2006-12-06

great, i'll try that and get back to you ..


RE: phpbb link conversion - talisman - 2006-12-11

hiya, just got round to this christian..

i get an error when i put in the original board url..

Quote:Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.

any thoughts..


RE: phpbb link conversion - Chris W. B. - 2006-12-11

add the following to the top of the original index.php file:

define("IN_MYBB", 1);

make sure it goes inside the <?php

?> tags.

RE: phpbb link conversion - Martin M. - 2006-12-11

require_once "./global.php";
define('IN_MYBB', 1);

RE: phpbb link conversion - talisman - 2006-12-11

thanks guys...all sorted Smile

RE: phpbb link conversion - labrocca - 2006-12-11

Hmm...I could use this too...thanks.