Hide parent directory in Apache

More...

Apache can generate directory indexes, automatically, similar to the Unix ls command or the Win32 dir shell command. Normally, Apache will create list of all directories and files inside a directory. With default settings, parent directory will be displayed too. If you want to hide parent directory from the directory list, use IndexIgnore directive.

Open httpd.conf and near to the IndexOptions add the following line:

IndexIgnore ..

After "httpd restart" or "httpd graceful", parent directory should disappear. All details about directory indexes can be found at Apache mod_autoindex page.

This entry was posted on February 18, 2009 and is filed under Apache

Related posts

2 Responses to Hide parent directory in Apache

  1. Alok Verma says:

    please suggest how to disable web hosting.

  2. dbunic says:

    @Alok Verma - Can you give me more details and what exactly do you mean with disabling web hosting? A web hosting is a type of Internet hosting service that allows making public websites. If you want to make your web content inaccessible, just change read permissions on document root. In that moment, web server will not be able to read any file and web site will be closed.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

In case of posting HTML tags or JavaScript code please convert special characters to HTML entities.
Especially pay attention to convert "<" to "&lt;" character!