1

我将我的 vbulletin 论坛转换为 bbpress,一切正常,除了旧网址部分的重定向。

我想使用 .htaccess 将旧的 vbulletin 网址重定向到新的 bbpress 网址,但我不知道该怎么做。我还是 URL 重定向的新手。

旧 vBulletin 网址:

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

新的 bbPress 网址:

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

谁能帮我?我真的很感激。

更新:这是我的 .htaccess 文件的内容。

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]
4

1 回答 1

1

尝试将这些规则添加到www.forum.site.com域的文档根目录:

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