Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-09-29 21:06:54

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Protecting directories from prying eyes

ruud, I’ve tested Gallery2 and it puts the image directory outside the web root with a fancy .htaccess file and uses a php script to grab the images, so I can relate to your earlier post.

The example .htaccess above doesn’t include all the directories, like /include or /lib, is it because these are safe to leave open or because it would cause problems?

Offline

#14 2006-09-29 21:30:20

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Protecting directories from prying eyes

What my .htaccess example does is deny access by default and grant access only to the files mentioned. Since /lib and /include aren’t mentioned, you can’t access them. (just corrected a mistake, because you don’t need access to publish.php)

Last edited by ruud (2006-09-29 21:32:31)

Offline

#15 2006-09-29 23:16:10

hcgtv
Archived Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
Website

Re: Protecting directories from prying eyes

ruud, I uploaded your .htaccess into 5 sites running 4.0.3 and 1 site that’s running what is to be 4.0.4 and I have no problems to report.

I uploaded an index.php to /files and /images containing 1 line:
<code><?php header(“Location: ../”) ?></code>

Now I feel better, thanks for taking the time.

Offline

#16 2006-09-30 11:37:26

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Protecting directories from prying eyes

It’s much simpler than that:

Options -Indexes

Offline

#17 2006-09-30 13:58:04

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Protecting directories from prying eyes

Mary wrote:

It’s much simpler than that:

Super! Thanks :)

Offline

Board footer

Powered by FluxBB