【发布时间】:2014-10-19 20:35:36
【问题描述】:
我在 public_html 文件夹中有一个 .htaccess,内容如下:
RewriteBase /
DirectoryIndex index3.php
RewriteRule ^faq/?$ faq.php [NC,L]
RewriteRule ^privacy/?$ privacy.php [NC,L]
RewriteRule ^blog/?$ blog.php [NC,L]
以下行阻止安装在我的站点中的 wordpress 博客:
DirectoryIndex index3.php
我的意思是,每当我转到http://mywebsite.net/blog/wp-admin/ 时,都会收到此错误:
您无权访问此服务器上的 /blog/wp-admin/。
在 /public_html/blog/.htaccess 中还有另一个 .htaccess 文件,其中包含以下内容:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
我该如何解决这个问题?奇怪的是我不记得修改了什么,这一切都是突然发生的。
文件夹结构
public_html
index.php
index3.php
faq.php
privacy.php
blog
wp-admin
wp-content
wp-includes
.htacces
index.php
【问题讨论】:
-
删除第一个 .htaccess 文件中的博客规则...
-
这没有帮助。删除
DirectoryIndex index3.php行会有所帮助,但这显然是不可能的。 -
将其更改为
DirectoryIndex index.php成功了,但我不知道为什么?这是一个奇怪的世界。