Question

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]
Was it helpful?

Solution

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]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top