apache - 如何覆盖 /icons 的索引?
我没有意识到这一点,这有点有趣;当您在主机根目录中命名一个目录 icons 时,如果您将浏览器指向 host.com/icons,apache 不会从该目录中读取内容,而是会向您显示一个 Public 列表域图标。
我在根目录中添加了一个 icons 目录,并在该目录中放置了一个 key.png 文件,但访问该图像会导致 404。我试图查找是否/在何处记录了此内容以及它是如何记录的关闭。我什么也没找到。有人可以提供指点吗?
PS 我使用的是 XAMPP 1.7.3,它基本上是一个 WAMP,并且有 Apache 2.2.14
编辑
显然,许多实时服务器都启用了此功能,并且可以看到很多地方。
I wasn't aware of this, and it is kind of funny; when you name a directory icons in the root of your host, then if you point your browser to host.com/icons, apache does not read from that directory and shows you a listing of Public Domain Icons.
I added an icons directory to the root and placed a key.png file in that directory, yet accessing that image results in 404. I tried to find if/where this has been documented and how it could be turned off. I found nothing. Could someone provide a pointer?
P.S. I am using XAMPP 1.7.3 which basically is a WAMP and has Apache 2.2.14
Edit
Aparently lots of live servers have this turned on and index of /icons could be seen lots of places.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
打开此文件:
%XAMPP_PATH%\apache\conf\extra\httpd-autoindex.conf
并将:更改
为:
重新启动 Apache 服务器。
Open this file:
%XAMPP_PATH%\apache\conf\extra\httpd-autoindex.conf
and change :
to this:
Restart your Apache Server.
我假设您的 httpd.conf 中有一个别名。
我不熟悉 XAMPP 的配置文件或其位置(谷歌建议它可能位于 \xampp\apache\conf\httpd.conf 中),但我建议您寻找如下所示的行:
请参阅 http://httpd.apache.org/docs/current/mod/mod_alias.html了解更多信息。
编辑:
根据 XMAPP site,您需要检查
\xampp\ apache\conf\httpd.conf
和extra
子文件夹。I'd assume that you have an alias within your httpd.conf.
I'm not familiar with XAMPP's config files or their location (google suggests it's probably in \xampp\apache\conf\httpd.conf) but I'd suggest you're looking for a line like the following:
See http://httpd.apache.org/docs/current/mod/mod_alias.html for more info.
EDIT:
According to XMAPP site, you need to check
\xampp\apache\conf\httpd.conf
and theextra
subfolder.我会查看您的 apache 配置文件 (\xampp\apache\conf\httpd.conf) 或 .htaccess 文件,看看是否存在重定向。
编辑:我认为 Grhm 是正确的,因为
Alias
位于您的配置文件中的某处,根据 XAMPP 站点:查看 \xampp\apache\conf\ 目录中是否有一个名为 extra 的目录,然后浏览其中的文件并查看该别名是否存在。
I would look in either your apache config file (\xampp\apache\conf\httpd.conf) or your .htaccess files and see if there is a redirect going on.
EDIT: I think Grhm is correct in that an
Alias
is in your config file somewhere, per the XAMPP site:See if there is a directory called extra in the \xampp\apache\conf\ directory and then go through the files in there and see if that Alias is present.