【问题标题】:WordPress .htaccess RewriteRule not workingWordPress .htaccess RewriteRule 不起作用
【发布时间】:2013-06-22 01:34:37
【问题描述】:

重新启动了一个网站,许多旧页面需要重定向到新页面。

我认为使用 htaccess 会很简单,但 wordpress 有其他想法。 Htaccess 的“重定向 301”似乎并不支持 wordpress 所做的所有事情。很多论坛和帖子都建议使用“RewriteRule”。

这是我在根目录中使用的 htaccess 代码。我的代码是以'RewriteBase /'开头的两行。 我希望通过转到 http://www.example.com.au/skps/contact.html 它将我重定向到 http://www.example.com.au/about/ 。 这只是行不通。

DirectoryIndex index.html index.htm index.php

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
#
RewriteBase /
RewriteRule ^skps/contact.html$‎ http://www.example.com.au/about/ [R=301,L]
#
RewriteBase /digiseen/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /digiseen/index.php [L]
</IfModule>

# END WordPress

【问题讨论】:

    标签: php wordpress .htaccess


    【解决方案1】:

    虽然这不能直接回答您的问题,但我在使用 Redirection 插件来解决此类问题时运气更好。

    它非常易于使用,当我重新设计或更改网站结构时,我会使用这个插件几个月(直到搜索引擎重新索引该网站)。当然,如果您愿意,您可以无限期地保持开启状态。

    【讨论】:

    • Jared,我认为您的建议可能是最简单的方法。谢谢!
    猜你喜欢
    • 2019-03-17
    • 1970-01-01
    • 2012-12-10
    • 1970-01-01
    • 2012-12-30
    • 1970-01-01
    • 2013-06-22
    • 1970-01-01
    相关资源
    最近更新 更多