On my server, I’ve created a folder that doesn’t have an index.php or index.html.
folder1/test.php
folder1/sample.php
folder1/hello.php
When I tried to visit that folder, it shows all the files in there.
That is my concern, it should not show the files in my folder because it is prone to hacking. It should display a page like a 403 Forbidden. I don’t want to used an index.php just to redirect them to somewhere.
I heard that this involves .htaccess and this is a smart thing to do.
Kindly teach me how to do it.
In a
.htaccessfile in your document root…See http://httpd.apache.org/docs/2.2/mod/core.html#options