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

Redirecting MyBB URL's

Solidus

Well-known member
#1
Hello.

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,

/thread-30028.html
/forum-121.html
/user-2.html

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

Thank you.
 

Solidus

Well-known member
#3
Really? That's it? That's great.
As for .htaccess rules, what represents the thread ID in this?

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

Jake Bunce

XenForo moderator
Staff member
#4
Really? That's it? That's great.
As for .htaccess rules, what represents the thread ID in this?

Code:
RewriteEngine on
RewriteRule [^/]+/([\d]+)-.+-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule [^/]+/([\d]+)-.+.html showthread.php?t=$1 [NC,L]
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.
 

Solidus

Well-known member
#5
/thread-30028.html
With pagination,
thread-29248-page-2.html

Only the number changes.
Can it be done for forum pages and profiles too?
/forum-100.html
/forum-100-page-2.html
/user-2.html
 

Jake Bunce

XenForo moderator
Staff member
#6
Page numbers aren't preserved in the redirects.

Try this for the threads:

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

Joshua

Active member
#7
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!
 

Jake Bunce

XenForo moderator
Staff member
#8
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!
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:

http://xenforo.com/community/thread...-to-xenforo-with-redirects.29979/#post-344747
 

Jake Bunce

XenForo moderator
Staff member
#16
@jmcl07

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

Code:
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]
 
#17
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?
 

Breixo

Active member
#20
Upload these redirect scripts:

http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/

They are made for vB3 but it doesn't matter. They perform the mapping of old ids to new ids.
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: