Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved redirect old phpbb links and page rank issues
#1
Not Solved
Hello
I am still doing convertion locally from phpbb3.0.7 to mybb
I have two questions:
- Does the merger script preserve forum, post and topic IDs, so that
/phpbb/topic8230.html ---> /mybb/thread-8230.html
/phpbb/topic1677.html#p28062 ---> /mybb/thread-1677-post-28062.html#pid28062
etc...

2- If so Ids are preserved, how to set a redirection so old phpbb links point to mybb ones ? I hope to preserve page ranks in Search engines?
منتدى لعشاق القراءة وأصدقاء الكتاب:ء
http://www.hijaj.net
فضاء الفلسفة، دروس الفلسفة للباكاوريا:ء
http://www.falsafa.info
#2
Not Solved
No, it doesn't AFAIK
#3
Not Solved
THanks for quick reply,thought it is sad to hear it Sad
Well, is there any way to redirect old phpbb links to the mybb search or index page for example?
I am talking about thousands of links spidered by google which are now pointing to nothing but to "Page Not found" !!!
منتدى لعشاق القراءة وأصدقاء الكتاب:ء
http://www.hijaj.net
فضاء الفلسفة، دروس الفلسفة للباكاوريا:ء
http://www.falsafa.info
#4
Not Solved
This user has been denied support. This user has been denied support.
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.

In convert/resources/functions.php, find

$drop_list = array(
    "users" => array('import_uid', 'import_usergroup', 'import_additionalgroups', 'import_displaygroup'),
    "forums" => array('import_fid', 'import_pid'),
    "threads" => array('import_tid', 'import_uid', 'import_poll'),
    "polls" => array('import_pid', 'import_tid'),
    "usergroups" => array('import_gid'),
    "privatemessages" => array('import_pmid'),
    "events" => array('import_eid'),
    "attachments" => array('import_aid'),
);

For threads redirection, you want to keep the import_tid for threads, so take import_tid out of the drop list for threads:

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

Then in your forum main directory you write a small 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 your .htaccess you add a rewrite rule that makes request for your old urls go to the mergeredirect.php

RewriteRule ^topic([0-9]+)\.html$ mergeredirect.php?tid=$1 [L]

After 4-8 weeks or so, consider removing the redirection and the import_tid field from the threads table.

Also, a Sitemap (Google SEO plugin) may help Google in picking up your new links.
#5
Not Solved
@frostschutz
Thanks a lot
At least, now there is a hope to keep page rank from serach engines Smile
I am still doing convertion tests locally, so I will try your fix, and go back to you whith any feed back
cheers
منتدى لعشاق القراءة وأصدقاء الكتاب:ء
http://www.hijaj.net
فضاء الفلسفة، دروس الفلسفة للباكاوريا:ء
http://www.falsafa.info
#6
Not Solved
This user has been denied support. This user has been denied support.
Yeah, please tell me if it works. I never used the merge system so I haven't actually tested it. Toungue
#7
Not Solved
Actually frostschultz's method works best if you use the old phpBB filename for it Toungue That way people not using the SEO Urls can get it with the old topics.php or whatever file as well.
#8
Not Solved
@ Dylan M
Thanks for comment
I was using phpbb-seo, so does it mean frostschutz's method will not work for me?

@ frostschutz
where sould I put .htaccess? in domain root or in mybb root folder?
منتدى لعشاق القراءة وأصدقاء الكتاب:ء
http://www.hijaj.net
فضاء الفلسفة، دروس الفلسفة للباكاوريا:ء
http://www.falsafa.info
#9
Not Solved
This user has been denied support. This user has been denied support.
Usually in the MyBB folder. It depends on your setup though. If the old forum was in a different folder than the new one (as you described in your first post), then you'd need a .htaccess in the old folder that does a generic redirect to the new folder, and then a .htaccess in the new folder that takes over from there. This would mean two redirects instead of just one but that's fine as long as it works.
#10
Not Solved
Wonderfull SmileSmile Thanks a lot
I putted one redirection only in domain root:
RewriteRule ^phpbb/topic([0-9]+)\.html$ /mybb/mergeredirect.php?tid=$1 [L]
As far I tested it , it is working like a charme !!!
So can I keep only this single redirection rule?
Two extra questions:
1- Is there any chance to get links like:phpbb/post24976.html redirected as well?
2- if not possible, what redirection rule to put into htaccess so any other old link, except topic[..].html, will be redirected to mybb search page?

منتدى لعشاق القراءة وأصدقاء الكتاب:ء
http://www.hijaj.net
فضاء الفلسفة، دروس الفلسفة للباكاوريا:ء
http://www.falsafa.info
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)