1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirecting MyBB URL's

Discussion in 'Installation, Upgrade, and Import Support' started by Solidus, Mar 5, 2012.

  1. Solidus

    Solidus Well-Known Member


    I've not converted my MyBB forum yet, but I know this will be a problem, so I am posting now.
    Is there any way to redirect old MyBB url's to XF links? Using htaccess perhaps?
    MyBB URL's look like this,


    I've got a lot of indexed url's so I hope there's a way to do this.

    Thank you.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  3. Solidus

    Solidus Well-Known Member

    Really? That's it? That's great.
    As for .htaccess rules, what represents the thread ID in this?

    RewriteEngine on
    RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
    RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You need to write rules for your myBB URLs. Can you post an example of a thread URL in myBB? I can make a rewrite rule for you.
  5. Solidus

    Solidus Well-Known Member

    With pagination,

    Only the number changes.
    Can it be done for forum pages and profiles too?
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Page numbers aren't preserved in the redirects.

    Try this for the threads:

    RewriteEngine on
    RewriteRule /thread-([0-9]+)\.html showthread.php?t=$1 [NC,L]
    Forums and users links are similar.
  7. Joshua

    Joshua Active Member

    Can someone confirm if these redirect scripts still work for MyBB -> XF conversion? I'm having GConverter.com do the migration for me. Thanks in advance!
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The important thing is having an id map. When you import to XF the id maps are stored in xf_import_log. But there is no direct importer from MyBB to XF. You can do a double import by way of another supported system like vB, IPB, or phpBB, but then extra effort is required to flatten the id maps so that you can use the above redirect scripts. Here is an example of the process of creating redirects for double imports:

  9. Joshua

    Joshua Active Member

    So maybe going with GConverter isn't the best way?
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I don't know how GConvert does it. Ask them if they handle redirects.
  11. Joshua

    Joshua Active Member

    They said they do not handle redirects.
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    If redirects are important to you then I will offer to do your import. I can preserve the id maps for redirects.
  13. RoldanLT

    RoldanLT Well-Known Member

    This not possible, mybb to xenforo url redirect.
    Except if you retain ID.
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  15. jmcl07

    jmcl07 Member

  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member


    Place these rules at the top of the .htaccess file in the old /forums directory where MyBB was:

    RewriteEngine On
    RewriteCond %{QUERY_STRING} (^|\?)tid=([0-9]+)&pid=([0-9]+)($|&)
    RewriteRule ^showthread\.php$ http://community.therealsocom.com/posts/%3/? [R=301,L]
    RewriteCond %{QUERY_STRING} (^|\?)tid=([0-9]+)($|&)
    RewriteRule ^showthread\.php$ http://community.therealsocom.com/threads/%2/? [R=301,L]
    RewriteCond %{QUERY_STRING} (^|\?)action=profile&uid=([0-9]+)($|&)
    RewriteRule ^member\.php$ http://community.therealsocom.com/members/%2/? [R=301,L]
    NeoCHI, nofix and jmcl07 like this.
  17. jmcl07

    jmcl07 Member

    Thank you @Jake Bunce ... Can I delete the mybb folder after doing this though? I want to clear the space on the server if possible.

    Where just the forums folder remains with the htaccess file?
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes you can. The rewrites don't depend on the contents of that directory.
    jmcl07 likes this.
  19. jmcl07

    jmcl07 Member

    Cool thank you!
  20. Breixo

    Breixo Active Member

    I was looking for someone with a similar experience but I can't find it.
    My case: I'm changing from oldserver & olddomain with Mybb to newserver&newdomain with Xenforo.
    I already imported threads, members... in the newserver and newdomain using http://xenforo.com/help/importing/

    Now my question is, how can I redirect mybb properly? I read this: http://xenforo.com/help/import-redirection/

    Should I import these scripts at newserver? http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/
    Or they should be placed at oldserver?
    Should I change htaccess at oldserver or at newserver?

    Thanks for your help!
    Last edited: Dec 22, 2013

Share This Page