Xampp,禁止非索引文件访问
我已经使用 xampp 很长时间了,它总是工作得很好。 我目前正在开发一个项目,几天前还运行良好。 现在,对于任何未命名为 index.php 的文件,我都会收到 403 访问禁止页面。 任何人都知道为什么会发生这种情况。
我使用的是 Windows XP,并且安装了 Xampp 版本 1.6.4。
I've been using xampp for a long time and it's always worked fine. I have a project I am currently working on and it was working fine just a couple of days ago. Now I am getting 403 Access forbidden page for any file that is not named index.php. Anyone have any ideas why this might be happening.
I'm on Windows XP and have Xampp Version 1.6.4 installed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的第一个猜测是 .htaccess 文件(或 httpd.conf 文件)的问题。
需要记住的一点是:
Apache 处理 .htaccess 规则的方式是“级联”,这意味着它将检查您尝试访问的文件路径上的每个 .htaccess 文件,因此,如果您有一些规则禁止用户查看任何任何时候非索引文件,都会影响所有更深的目录。
话虽如此,如果您知道问题不在于
httpd.conf
文件,请检查发布路径的根目录是否有.htaccess
文件。 将其更改为.htaccessold
并查看是否可以访问 htdocs 目录中除 index 之外的任何文件。有两个问题:
index.php
更改为tempindex.php
并创建一个名为index.html
的新文件,您能看到吗?祝你好运。 请随时通知我。
My first guess would be an issue with the .htaccess file (or httpd.conf file).
Something to keep in mind:
The way that Apache handles .htaccess rules is "cascading" meaning that it will check every .htaccess file along the path of the file you are trying to access, so if you have some rule forbidding users from viewing any non-index files at any point, it will affect all deeper directories.
Having said that, if you know the issue isn't with the
httpd.conf
file, check to see if the root of the publishing path has a.htaccess
file. Change it to.htaccessold
and see if you can access any files in the htdocs directory other than index.Two questions:
index.php
totempindex.php
and create a new blah file calledindex.html
can you see that?Good luck. Keep me posted.
了解 Apache 返回此错误消息的原因的唯一方法是查看错误日志。
我们可以猜测可能的原因,但如果您花时间查看,Apache 将能够告诉您。
The only way you can see why Apache is returning this error message is to look at the error log.
We can guess at possible causes, but Apache will be able to tell you if you take the time to look.
听起来您更改了一些
mod_rewrite
规则或站点的 apache 配置。 您是否在.htaccess
文件中添加或更改了任何内容?您可能需要提供更多详细信息才能弄清楚这一点。
It sounds like you changed some
mod_rewrite
rules or your site's apache configuration. Did you add or change anything in an.htaccess
file?You're probably going to have to give more details in order to figure this out.