开发者

apache - how to override index of /icons?

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 i开发者_如何学运维t 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.


Open this file: %XAMPP_PATH%\apache\conf\extra\httpd-autoindex.conf

and change :

Alias /icons/ "X:/xampp/apache/icons/"
<Directory "X:/xampp/apache/icons/">

to this:

Alias /icons/ "./icons/"
<Directory "./icons/">

Restart your Apache Server.


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:

Alias /icons/ /usr/local/apache/icons/

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 the extra subfolder.


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:

The main configuration file for Apache. It's including other files from the subdirectory "extra".

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜