1

我正在尝试重定向那些网址(来自 phphbb)

http://www.example.com/fraiseuses/restauration-gambin-10n-t33924-45.html
http://www.example.com/fraiseuses/une-gambin-10n-plus-sur-forum-t34642.html#p675680 

到正确的 xenforo 网址

http://www.example.com/threads/restauration-gambin-10n.33924/page-3
http://www.example.com/threads/34642/page-1#post-675680

我的 htacces

RewriteEngine On

RewriteRule ^post([0-9]+).html$ /posts/$1 [R=301,L]
RewriteRule ^.*-f([0-9]+)$ /forums/$1 [R=301,L]
RewriteRule ^[^/]+/topic([0-9]+).html /threads/$1 [R=301,L]
RewriteRule ^.*-t([0-9]+).html /threads/$1 [R=301,L]


RewriteRule ^[^/]+/[^\./]+-t([0-9]+)-15\.html$ /threads/$1/page-1 [R=301,L]
RewriteRule ^[^/]+/[^\./]+-t([0-9]+)-30\.html$ /threads/$1/page-2 [R=301,L]
RewriteRule ^[^/]+/[^\./]+-t([0-9]+)-45\.html$ /threads/$1/page-3 [R=301,L]

不幸的是我找不到我的错误,有人可以指出我的错误吗?谢谢。

4

2 回答 2

0

没有特定于 phpBB 的重定向脚本,但这些将起作用::

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

这些脚本的基本功能是将旧 ID 映射到新 ID。给定适当的重写规则,它们可以使用 phpBB URL。以下是适合您的步骤:

1) 将这些重定向脚本上传到您的旧论坛位置(/forum 文件夹):

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

您只需要 301config.php 文件和 showthread.php 文件来重定向线程(这是最重要的)。

2) 编辑 301config.php 文件。取消注释此行(删除 //)并指定 XF 目录的路径:

//  $fileDir = '/home/username/www/forums';

如果导入日志表的名称不是默认值 (xf_import_log),您可能还需要指定它。它可能被命名为archived_import_log:

//  define('IMPORT_LOG_TABLE', 'import_log_x');

3) 将这些重写规则添加到 /forum 目录中的 .htaccess 文件中。这是基于以前的 phpBB 导入。我假设您的网址遵循相同的格式:

RewriteEngine on

RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$)
RewriteRule ^viewtopic\.php$ /forum/showthread.php?t=%2 [L,R=301,NC]
于 2015-05-19T16:27:07.873 回答
0

谢谢

我这样做了:

 RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$) [NC]
    RewriteRule ^viewtopic\.php$ /threads/%2? [L,R=301,NC]
    RewriteCond %{QUERY_STRING} (^|&)p=([0-9]+)(&|$) [NC]
    RewriteRule ^viewtopic\.php$ /posts/%2? [L,R=301,NC]
    RewriteCond %{QUERY_STRING} f=(\d+)$ [NC]
    RewriteRule ^viewforum\.php$ /forums/%1 [L,R=301,NC]
    RewriteRule ^viewforum\.php$ /forums/%1? [L,R=301,NC]
于 2015-05-20T17:00:10.997 回答