How to prevent or allow directory listing?
Having a listable directories on your site sometimes is useful. However, some times it can be considered a security issue. No, matter which option you prefer you can control this behavior of your site using 1 simple line:
The above line enables Directory listing.
The above disables directory listing for your web site.
The .htaccess file gives more then simply enabling and disabling of a directory listing.
With .htaccess file you can control which files to be ignored when creating a directory list.
IndexIgnore *.gif *.zip *.txt
Will make the apache server to skip all gif, zip and txt files from the directory list.
Convenient, isn’t it.
Will just create an empty directory list.
- How to block users from accessing your site based on their IP address
- How to prevent or allow directory listing?
- How to change the error documents – 404 Page Not Found, etc
- Using .htaccess for password protecting your folders
- Using .htaccess to block referrer spam
- Disable Hot-Linking of images and other files
- Redirect URLs using .htaccess
- Introduction to mod_rewrite and some basic examples
- Force SSL/https using .htaccess and mod_rewrite
- 301 Permanent redirects for parked domain names
- Enable CGI, SSI with .htaccess
- How to add Mime-Types using .htaccess
- Change default directory page
- Block Bad robots, spiders, crawlers and harvesters
- Make PHP to work in your HTML files with .htacess
- Change PHP variables using .htaccess
- HTTP Authentication with PHP running as CGI/SuExec
- Force www vs non-www to avoid duplicate content on Google
- Duplicate content fix index.html vs / (slash only)
Comments 14 >>
|Previous: How to block users from accessing your site based on their IP address||Next: How to change the error documents – 404 Page Not Found, etc|
Back to Web Hosting Articles list