views:

971

answers:

4

Is it possible to hide the folders in my root folder? Just in case my index.php would disappear you know?

Could I also show 404 error not found if someone requests them?

A: 
IndexIgnore *

The above would prevent all files from being listed. Here * acts as a wildcard. You could replace it with something more specific, if needed.

Alan Haggai Alavi
A: 

Take a look at .htaccess tips and tricks

adatapost
+5  A: 

What you want is probably

Options -Indexes

which will just give a 404 error if no DirectoryIndex file is found.

I think it’s rather a 403.
Gumbo
+1  A: 

As mentioned by duskwuff, what you need is

Options - Indexes

This will cause a 403 forbidden error on that particular directory. Thus to provide a custom error page you will need

ErrorDocument   403 myErrorPage.html

Hope this helps

Pratik Bhatt