Hide parent directory in Apache

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.

2 thoughts on “Hide parent directory in Apache

  1. @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 Comment