[BlueOnyx:01755] Re: protecting directory

blueonyx at larsi.de blueonyx at larsi.de
Thu Jul 16 16:05:35 -05 2009


Thank you very much Greg!

My customer believes with a download manager you could stil view the pictures. So someone told him to create his image dir above the web dir. But I will try your index.php. Maybe it will be enough secure for his website. :-)

Thanks,
Lars.


        processed by David.fx 
Subject: [BlueOnyx:01753] Re: protecting directory (16-Jul-2009 22:30)
From:    Greg Schiedler <greg at limo.net>
To:      blueonyx at blueonyx.it





On Thu, Jul 16, 2009 at 11:51 AM, <blueonyx at larsi.de> wrote:


Hello list,

a customer of us wants to secure his images directory. So he planned to put his images dir besides the web dir, so no one could link directly to the images.

Unfortunatly I have no idea, how to do this. His website uses php, but there is no chance to use sessions. So putting the images dir above the web dir should be the easiest solution for him.

Could someone tell me, how to tell apache to use this directory for the images?

Thanks,
Lars.

i have used for years a simple index.php file. You can add additional ../ (Period Period Slash) for the location depending on what level of the directory tree your trying to protect.


As it is shown http://www.domain.com/images  will re-direct the browser to http://www.domain.com (Location ../ is up one level) 


Will not protect a direct link to the image but will not allow a directory listing. 


index.php


<?php


/**
 * index.php
 *
 * Copyright (c) 2003-2009 Limo.Net Internet Services
 *
 * This file simply takes any attempt to view source/image files and sends those
 * people to the home page.
 *
 */


header("Location:../");


/* pretty impressive huh? */


?> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20090716/34d9ed67/attachment.html>


More information about the Blueonyx mailing list