【发布时间】:2012-07-23 11:00:50
【问题描述】:
在诸如http://website.com/sub/index.html 等拥有自己的.htaccess 的子目录上,由于某种原因,仍然显示我为Wordpress 拥有的404 页面,该页面位于该目录之上。
.htaccess 用于子目录:
ErrorDocument 404 /404.html
.htaccess 用于主目录:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^website.net$ [OR]
RewriteCond %{HTTP_HOST} ^www.website.net$
RewriteRule ^foghelper.php$ http://website.net/subdirone/ [R=301,L]
RewriteRule ^foghelper.php$ http://website.net/subdirtwo/ [R=301,L]
# DO NOT REMOVE THIS LINE AND THE LINES ABOVE jNLK5d:REDIRECTID
# 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
如果您想知道,hta 中的链接会被审查。
编辑:
在RewriteRule . /index.php [L] 之前添加RewriteCond %{REQUEST_URI} !^/?sub/ 后,错误似乎仍然存在。
【问题讨论】:
-
你看过这篇文章吗? stackoverflow.com/questions/2322559/…希望对您有所帮助!
标签: wordpress .htaccess http-status-code-404