【发布时间】:2015-03-20 07:29:20
【问题描述】:
我正在编辑的 .htaccess 文件包含以下用于将 http://www.example.com 重定向到 http://example.com 的代码:
AddHandler fcgid54-script .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
在没有从头开始编写新的 .htaccess 文件的情况下,我希望重定向一些返回 404 的其他页面。我尝试了以下方法,但没有成功:
AddHandler fcgid54-script .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
301 Redirect /blank/blah/page/ http://example.org/blank/blah/
# END WordPress
我还尝试了许多其他迭代,但到目前为止没有任何效果。
【问题讨论】:
标签: .htaccess mod-rewrite redirect