301重定向.htaccess无法使用Wordpress

时间:2012-04-29 04:29:05

标签: wordpress .htaccess mod-rewrite

我已经低于301重定向底部的一个我希望它能正常工作,但它现在还没有工作。

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
RewriteCond %{HTTP_HOST} ^domain.com.au$
RewriteRule ^/?$ "http\:\/\/www\.domain\.com\.au\/" [R=301,L]
RewriteRule ^author/privacy?$ privacy [R=301,L]

有原因吗?

我想将作者/隐私重定向到隐私......

2 个答案:

答案 0 :(得分:1)

这里的规则顺序是有问题的。这是固定版本:

# BEGIN WordPress
<IfModule mod_rewrite.c>

Options +FollowSymLinks +Indexes
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^domain\.com\.au$ [NC]
RewriteRule ^$ http://www.domain.com.au/ [R=301,L]

RewriteRule ^author/(privacy)/?$ /$1 [R=301,L,NC]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>
# END WordPress

答案 1 :(得分:0)

刚出现同样的问题,但这就是答案...... 使用相对URL不完整http://等 剪切以下代码并添加到.htaccess文件并添加到根目录

Redirect 301 /page1.php /page2.html
Redirect 301 /page3.php /page4.html


 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>