.htaccessvbulletinmybb

Redirect MyBB pages to vBulletin


I've recently purchased a very small forum powered by MyBB and merged the data with my larger vBulletin forum.

A normal redirect won't work as the vBulletin board is a long established one and on another domain, thread 2 on the MyBB board is now thread 546 on the vBulletin site.

Is it at all possible in htaccess to redirect mybbsite.com/forum/showthread.php?tid=2 to vbsite.com/forum/showthread.php?t=546

Like I said the MyBB board is very small, consisting of only 50 threads so it's no major issue if this can't be done.

Kind Regards

--Matt


Solution

  • You can match against the query string using mod_rewrite. You can add something like this in your .htaccess file:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} mybbsite.com$ [NC]
    RewriteCond %{QUERY_STRING} ^tid=2$
    RewriteRule ^forum/showthread.php$ http://vbsite.com/forum/showthread.php?t=546 [L,R=301]
    

    You can replicate these 2 conditions and the rewrite rule for your 50 or so threads.