0

将客户的网站从 HTML 转移到 WordPress 主题后,我遇到了一个奇怪的问题。

我正在使用插件“Simple 301 Redirects”将所有旧的 HTML 页面转发到更新的 WordPress URL——总共大约 50 个重定向。

这个插件在许多其他网站上对我来说效果很好,但出于某种原因,301 重定向适用于大约一半的 URL,而另一半我收到 404 Page Not Found 错误。

我试图从插件中删除一个不起作用的重定向,并手动将其放置在 .htaccess 文件中,但这也不起作用。

关于为什么会出现这种情况的任何想法,以及为 WordPress 网站处理一长串 301 重定向的最佳方法是什么?

编辑:这是我的.htaccess,我实际上让这个工作。截至目前,我有 42 个使用“Simple 301 Redirects”插件的重定向工作,并且有 17 个使用同一个插件无法工作。

Options -Indexes

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteRule ^articles\.html$ http://www.magnuminvestigations.net/articles/ [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

这是一个当前不起作用的示例:

旧网址

http://www.magnuminvestigations.net/cheating_infidelity_investigators.html‎

新网址

http://www.magnuminvestigations.net/services/cheating-and-infidelity-investigations/
4

0 回答 0