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.

Bookmark and Share

Leave a Reply