Forums / General Questions / How to stop access to directories?

How to stop access to directories?

Views: 505

Results 1 to 6 of 6
5 Jan 2012, 6:52 PM
#1
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

How to stop access to directories?

Hi,

I have installed the latest Zen Cart and noticed that I can view the directory of my site past the includes folder.

domain.com/includes is blocked
but
domain.com/includes/templates etc. are not.

How do I stop this from happening?
I dont really want people from viewing all the files etc. in my site.

Thanks

5 Jan 2012, 7:25 PM
#2
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: How to stop access to directories?

You could drop an .htaccess file in the folders that contains this:

Options –Indexes

The best way to learn is to try stuff. But, back it up first.

5 Jan 2012, 7:34 PM
#3
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: How to stop access to directories?

Do I have to do that for every folder? There are a lot of them.

5 Jan 2012, 7:39 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How to stop access to directories?

What type of server are you hosting your ZC site on - windoze or linux?

20 years a Zencart User

5 Jan 2012, 7:52 PM
#5
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Re: How to stop access to directories?

Im on Linux / Litespeed

5 Jan 2012, 9:33 PM
#6
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: How to stop access to directories?

Drop this in the .htaccess file in your includes folder and it should block access to everything beneath it:

<Files *.php>
Order Deny,Allow
Deny from all
</Files>

The best way to learn is to try stuff. But, back it up first.