Ezilon.com - Target Your Audience, be Seen in Your Region

.htaccess to restrict access to directories

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 332 posts

Joined: Feb 2005

HI
I have a website and you can directly navigate to a directory and it will list all the files.

I need a .htaccess file to restrict the access (i think) but i keep finding information about password protecting the directory. I dont want to do that just avoid any access at all only include the files?

Can anyone help me.

Thanks.

pr0gr4mm3r's picture
ModeratorSponsor

He has: 978 posts

Joined: Sep 2006

Add this to your .htaccess file in the specific directory you want to limit access to:

Options -Indexes

They have: 332 posts

Joined: Feb 2005

Hi,

Thanks - perfect!

They have: 332 posts

Joined: Feb 2005

Hi

although this restricts file listing i can still go directly to the file in the browser?

How can i stop from directly accessing this. i only want to include this.

pr0gr4mm3r's picture
ModeratorSponsor

He has: 978 posts

Joined: Sep 2006

What types of files are in that directory?

Subscribe to this feed: Syndicate content