WordPress .htaccess RewriteRule not working


WordPress .htaccess RewriteRule not working

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

我认为这将是简单的htaccess,但wordpress有其他的想法。Htaccess的"重定向301"似乎不支持wordpress所做的所有事情。很多论坛和帖子都建议"rewriterrule"。

这是我在根目录下工作的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

虽然这并没有直接回答你的问题,但我使用重定向插件来处理这种事情的运气更好。

它很容易使用,当我做一个重新设计或改变网站结构,我使用这个插件几个月(直到搜索引擎重新索引的网站)。当然,如果您愿意,您也可以无限期地打开它。