|
Author |
hbghlyj
Posted at 2023-2-21 02:00:52
hbghlyj 发表于 2022-12-30 18:53
建议把旧论坛的内部链接批量替换为新论坛的链接
例如http://kuing.orzweb.net/redirect.php?tid=9018&goto=lastpost#lastpost
替换为https://kuing.cjhb.site/forum.php?mod=viewthread&tid=9018#lastpost
这样能增加一些inbound link
当Google bot抓取旧论坛的页面就会顺着链接过来
下面使用Apache mod_rewrite模块的方法不用替换链接能达到同样的效果:
- RewriteEngine On
- RewriteCond %{QUERY_STRING} tid=([0-9]+)&goto=(.*)$
- RewriteRule ^redirect\.php$ https://kuing.cjhb.site/forum.php?mod=viewthread&tid=%1 [R=301]
Copy the Code
把这个.htaccess 文件放在旧论坛的public_html
就能把帖子列表页的格式为http://kuing.orzweb.net/redirect.php?tid=9018&goto=lastpost#lastpost 的链接301重定向到https://kuing.cjhb.site/forum.php?mod=viewthread&tid=9018#lastpost
浏览器访问时, 自动跳转到新论坛的相同页面.
如下图, 在Online .htaccess tester测试成功
|
|