Forum Moderators: phranque

Message Too Old, No Replies

How can i disable the directory browsing through the .htaccess?

         

asantos

8:34 pm on Jun 7, 2006 (gmt 0)

10+ Year Member



How can i disable the directory browsing through the .htaccess?

Currently i have lots of index.php all over my website directories with this:
<?header('Location: ../');?>

I want to get rid of that and let the apache's htaccess handle it all over the way.

coopster

10:02 pm on Jun 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Seems you understand what the DirectoryIndex [httpd.apache.org] Directive will do for you, but next all you need to do is understand the Options [httpd.apache.org] (Indexes) configuration directive.

asantos

10:18 pm on Jun 7, 2006 (gmt 0)

10+ Year Member



hi coopster,
i know about that, but i dont have access to the server's httpd.conf

That's why i need to know if i can implement some kind of protection from within the .htaccess

jdMorgan

12:21 am on Jun 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As stated in the 5th line of the document coopster linked to above, DirectoryIndex can be used in .htaccess.

Jim

asantos

12:36 am on Jun 8, 2006 (gmt 0)

10+ Year Member



Oh, i didnt get. I thought it was just for the httpd.conf.

I added this line to my .htaccess and now everything is working like i needed:

Options -Indexes

Thanks again!
Andres