我正在尝试重定向这些urls (从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 url
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]不幸的是我找不到我的错误,有人能指出我的错误吗?谢谢。
发布于 2015-05-20 00:27:08
没有特定于phpBB的重定向脚本,但它们可以工作::
http://xenforo.com/community/threads/redirection-scripts-for-vbulletin-3-x.5030/
这些脚本的基本功能是将旧的ids映射到新的ids。只要有适当的重写规则,它们就可以使用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导入。我假设您的URL遵循相同的格式:
RewriteEngine on
RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$)
RewriteRule ^viewtopic\.php$ /forum/showthread.php?t=%2 [L,R=301,NC]发布于 2015-05-21 01:00:11
thx
我这样做了:
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]https://stackoverflow.com/questions/29877089
复制相似问题