无法使用 Apache 服务器访问子目录中的文件 [英] Can't access files in a subdirectory using Apache server

查看:44
本文介绍了无法使用 Apache 服务器访问子目录中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Windows 7 机器上安装了 Apache 2.2.21 服务器.我的网站已启动,并且 /scripts 子目录中的脚本正在运行,但是当我尝试从 /icons 加载图标时,出现 403 禁止错误.我已经将它添加到我的 httpd.conf 文件中:

I have an Apache 2.2.21 server installed on my Windows 7 machine. My site is up and my scripts from /scripts subdirectory are working but when I try to load icons from /icons I get a 403 forbidden error. I've already added this to my httpd.conf file:

<Directory "c:/wamp/www/icons/">
    Options Indexes FollowSymLinks
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

还是没有效果.所以问题是:如何访问 /icons 子文件夹中的文件?

Still no effect. So the question is: how can I access files in my /icons subfolder?

P.S.:使用 /images 子目录效果很好,但问题仍然存在.

P.S.: Using /images subdirectory worked out just fine but the question still remains.

推荐答案

我发现 /icons/ 被包含为其他目录的别名.对我来说,配置文件位于:

I figured out that /icons/ was included as an alias for some other directory. For me, configuration file was located at:

C:\wamp\bin\apache\apache2.2.21\conf\extra\httpd-autoindex.conf

我不得不注释掉这一行:

I had to comment out this line:

Alias /icons/ "c:/Apache22/icons/"

这篇关于无法使用 Apache 服务器访问子目录中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆