【问题标题】:301 redirect phpbb2 to xenforo301 将 phpbb2 重定向到 xenforo
【发布时间】:2015-08-25 11:35:15
【问题描述】:

有人可以帮我设置 .htaccess 吗?我需要将我的旧论坛网址 (phpbb2) 重定向到新的 xenforo 网址。

示例 老:

 www.myforum.de/ftopic7469.html

新:

 www.myforum.de/threads/werbelinks-hier-im-forum.7469/

论坛也一样:

旧:

 www.myforum.de/forum61.html

新:

 www.myforum.de/forums/wuensche-und-feedback.61/

感谢您的帮助!

【问题讨论】:

  • 您是否使用 apache 作为您的 Web 服务器?
  • 感谢您的回复,是的。

标签: .htaccess redirect


【解决方案1】:

尝试以下方法:

RewriteEngine on

RewriteRule ^ftopic([0-9]+)\.html$  /threads/$1 [R,L]
RewriteRule ^forum([0-9]+)\.html$  /forums/$1 [R,L]

请注意,它不会处理 slug,但是,根据 https://stackoverflow.com/questions/34473844/nginx-redirect-rewrite-vbulletin-urls-with-slug-to-xenforo-slug-optional/38166902#38166902,slug 部分实际上并不是强制性的,因此,我们不必担心。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-10-21
    • 1970-01-01
    • 1970-01-01
    • 2017-04-15
    • 1970-01-01
    • 1970-01-01
    • 2010-10-27
    相关资源
    最近更新 更多