phpbb link conversion

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 ).

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);
[Need Smilies? Get Me Smileys!
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 ?

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');
[Need Smilies? Get Me Smileys!
great, i'll try that and get back to you ..

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..

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

define("IN_MYBB", 1);

make sure it goes inside the <?php

?> tags.

require_once "./global.php";
define('IN_MYBB', 1);
thanks guys...all sorted Smile
Hmm...I could use this too...thanks.

Forum Jump:

Users browsing this thread: 1 Guest(s)