Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache - how to override index of /icons?

Tags:

apache

xampp

wamp

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.

like image 781
Majid Fouladpour Avatar asked Dec 13 '10 21:12

Majid Fouladpour


3 Answers

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.

like image 112
KennyKam Avatar answered Oct 14 '22 03:10

KennyKam


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.

like image 33
Grhm Avatar answered Oct 14 '22 03:10

Grhm


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.

like image 35
Austin Lin Avatar answered Oct 14 '22 04:10

Austin Lin