http://httpd.apache.org/docs/2.3/mod/mo ... dexoptionshttp://httpd.apache.org/docs/2.3/mod/core.html#options
When I visit my www.myname.com/images
via web browser, it shows a root directory. Where in my httpd do I change this? or is this located else where?
Options Directive wrote:Warning
Mixing Options with a + or - with those without is not valid syntax, and is likely to cause unexpected results.
In your xampp\apache\conf\extra\httpd-vhosts.conf
file you may have a Directory Directive similar to this:
- Code: Select all
<Directory "C:/xampp/path/to/your/website" >
Options +Indexes +FollowSymLinks +Includes +ExecCGI
Allow from all
You will see +Indexes
which is the Index Options Directive that gives you the unwanted file listing if no index.html/index.php
is present in a directory.
You need to change this to -Indexes
and you will then be given:
- Code: Select all
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
When trying to access a directory without an index file.
(Or in the default Directory Directive in the httpd.conf
file you would add -Indexes
after Options +FollowSymLinksOptions +FollowSymLinks -Indexes
This would default all directories to no directory file listing and give the Error 403 page.
You would then have to change any directory you want to have a file listing by adding Options +Indexes
in a .htaccess
file in that directory to override the default settings you set in your httpd.conf
By far the best solution and the most user friendly I have found to control directory listings in a given directory is to put either a blank index.html/index.php or a redirecting index.html/index.php file in the directory that sends the user to your home page or gives them a much friendlier error message.
If you look at most content manager scripts like Joomla etc. you will find they adopt this blank index.html strategy.
Also if any one cares to explain where does the .htaccess go?
Normally the .htaccess file goes into the root directory of your web site and controls all those files in the web site root directory and all the sub directories and their files under the root.
Or you can place a .htaccess file in a directory by directory basis.
Take a look at the new DeskTopXampp
launch control posted by ridgewood
http://community.apachefriends.org/f/viewtopi ... 967#103967
launch control for XAMPP
is available here:
I highly recommend DTX.