1

I converted my vbulletin forum to bbpress and everything works fine except the redirection of the old urls part.

I want to redirect old vbulletin urls to the new bbpress ones using .htaccess but i have no idea how to do it. I’m still new to URL redirection.

Old vBulletin URL:

http://www.forum.site.com/showthread.php?80-post-title

New bbPress URL:

http://www.site.com/forums/topic/post-title

Can anyone help me? I would really appreciate it.

UPDATED: Here are the contents of my .htaccess file.

RewriteEngine On
RewriteCond %{QUERY_STRING} ^[0-9]+-([^&]+)
RewriteRule ^/?showthread\.php$ http://www.site.com/forums/topic/%1 [L,R=301]

RewriteEngine on
Options +FollowSymlinks -MultiViews

# handles http redirect

RewriteCond %{SERVER_PORT} =80
RewriteCond %{HTTP_HOST} ^forum\.site\.com$ [NC] 
RewriteRule ^/?(.*)$ http://www.site.com/discussions [R=301,L,QSA,NE]

# handles https redirect
RewriteCond %{SERVER_PORT} =443
RewriteCond %{HTTP_HOST} ^forum\.site\.com$ [NC] 
RewriteRule ^/?(.*)$ https://www.site.com/discussions [R=301,L,QSA,NE]

1 Answer 1

1

Try adding these rules to the document root of the www.forum.site.com domain:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^[0-9]+-([^&]+)
RewriteRule ^/?showthread\.php$ http://www.site.com/forums/topic/%1 [L,R=301]
5
  • Thanks. It works but it's still not how i want it. I want to redirect all the vbulletin URLs to the new bbPress ones (which works great with the rules you posted) but i also want all the other vbulletin URLs(homepage, member profiles, forums, and all the other urls) to be redirected to the bbPress homepage. Dec 19, 2012 at 19:49
  • one thing i forgot to mention. i currently use a htaccess code to redirect all the urls from forum.site.com to site.com/forums . How can i make my code work with yours? Dec 19, 2012 at 20:00
  • @AllenPayne If you're redirecting forum.site.com to site.com/forums then that rule should be after the one above. As for all those other cases, you'll just need to deal with them on a case by case basis, that scope is outside of the question that you've asked (and would be impossible to ask and answer within comments)
    – Jon Lin
    Dec 19, 2012 at 20:56
  • i tried placing your rules first but it still not working. when i go to forum.site.com/showthread.php?80-post-title it redirects me to site.com . i just updated the first post with the current contents of my .htaccess file so you can take a look. Dec 20, 2012 at 6:54
  • Nevermind. It's working now. I was editing the htaccess file with my FTP program and i started to test if the rules work before saving the file. :)) Thanks a lot for your help. Dec 20, 2012 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.