MyBB Community Forums

Full Version: redirect old phpbb links and page rank issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(2010-11-30, 08:25 PM)Dylan M. Wrote: [ -> ]I'll see about posting a how-to in the next couple days.

Any update about it ?
Thanks
Ok, I did forget to come back to this. So I'll write it up now.

The first thing you need to do is make an edit to the Merge System to prevent removal of the fields.
In convert/index.php find line 821:
	delete_import_fields();
Either comment out or remove it.
This will leave you with all your import fields.

Now we have step 2. This is slightly more complex, and requires creating a file that is tailored to each board system that you may convert from. For this example we'll use phpBB2 since I happen to have it handy and it applies to this thread. For phpBB2 our first new file will need to be named viewforum.php - this goes in your MyBB fol
viewforum.php (untested example code, but should come close to working)
<?php
/*
 * phpBB2 to MyBB thread redirection
 */
define("IN_MYBB", 1);

require_once "./global.php";

require_once "./inc/functions.php";

if(!isset($mybb->input['f']) || empty($mybb->input['f']))
{
   die("No forum ID Specified");
}

$query = $db->simple_select("threads", "fid", "import_fid='{$mybb->input['f']}'");
$fid = $db->fetch_field($query, "fid");
$db->free_result($query);

// Build a url
$url = $mybb->settings[''bburl']."/forumdisplay.php?fid={$fid}";
// Redirect us now...
redirect(htmlentities($url));

exit;
?>

I'll continue this later. I've assigned it to myself so I wont forget again. But you can start with that and see if it works.
Remember you also need to copy the forum & topic SEO stuff from your phpBB2 .htaccess to your MyBB .htaccess for the SEO re-writes to work.
Thanks Daylan
Here is the phpbbseo stuff in htaccess file
# POST
RewriteRule ^bb/post([0-9]+)\.html$ /bb/viewtopic.php?p=$1 [QSA,L,NC]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^bb/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$
I do have a question:
deos the custom veiwtopic.php you posted will redirect post urls like : /bb/post1234.htm ?
I mean posts without Topic Id in url
That is the real issue, because topic urls like /bb/topic1234.html are already correctely redirected using frostschutz's tip posted here:
http://community.mybb.com/thread-82995-p...#pid604334

I am in no means a programer ! But I think we need some codes in veiwtopic.php to retreive the Topic parent ID using the post Id
I haven't posted viewtopic yet. Only viewforum. I'll be doing viewtopic after Christmas, too much going on with the holidays.

EDIT: And you're missing the viewforum SEO stuff.
(2010-11-27, 02:17 PM)frostschutz Wrote: [ -> ]It's possible to make the redirection, if you have not converted yet.

The merge system stores the old_id => new_id correlation during the merge. Only it removes this information once it's done merging. If you change the merge system to keep the info, you can write a small PHP script that redirects threads for you.
.
.
.
.
[/php]

I know this is very old but i got a question. What about people not using Phpbb-SEO plugin?
The normal urls are like /viewtopic?f=274&t=985 so both fID and tID are required. FID can be preserved by removing
"forums" => array('import_fid', 'import_pid'),
But how am i supposed to add the redirection? Confused
With SEO it gets more complicated. You have to have the file fixing I described above, AND add the SEO rewrites from your phpBB .htaccess to your MyBB .htaccess

As stated before though, this isn't (at this time) officially supported.
Hello,
I have the same problem
I dont know how it work !!!
first I change this in convert/resources/functions.php,

		"threads" => array('import_tid', 'import_uid', 'import_poll', 'import_firstpost'),

to
		"threads" => array('import_uid', 'import_poll', 'import_firstpost'),

then I make the merge from phpbb ti mybb

and then I use mergeredirect.php
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require("global.php");

// Did we get an old thread id?
if($mybb->input['tid'])
{
    // See if we can get a new one.
    $import_tid = intval($mybb->input['tid']);
    $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;
?>

Then in my .htaccess I add a rewrite rule that makes request for My old urls go to the mergeredirect.php

is this correct or I missed something ???
That was meant as an example of what could be done, not as a working piece.
didnt work for me please help me !!!
This isn't an official part of the merge, and thus isn't supported. What I wrote is an example file that someone could work from to build a proper file. You'll need to enlist the aid of someone with PHP experience to write it for you.
Pages: 1 2 3 4