WordPress .htaccess RewriteRule无效

时间:2013-06-22 01:34:38

标签: php wordpress .htaccess

重新启动网站,需要将许多旧网页重定向到新网页。

我认为这对于htaccess来说很简单,但是wordpress有其他想法。 Htaccess的'Redirect 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

1 个答案:

答案 0 :(得分:2)

虽然没有直接回答你的问题,但我有幸使用Redirection插件来做这类事情。

这很容易使用,当我正在重新设计或更改网站结构时,我使用这个插件几个月(直到搜索引擎重新索引网站)。当然,如果您愿意,可以无限期地保留它。