I want to make a directory private...
for example to access to images.domain.com appear forbidden and not list all the files...
how i can make this?
I want to make a directory private...
for example to access to images.domain.com appear forbidden and not list all the files...
how i can make this?
To disable directory listing you can add this to your .htaccess file:
Options -Indexes
gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer
Do you want to prevent all access (which is what "private" would mean)? Do you rather want to prevent Apache from making directory listings when there's no default index?
For the former, remove read and execute permissions from the directory. For the latter, add an Options -Indexes to the .htaccess file in the directory.
Last edited by misson; 05-10-2009 at 12:30 PM.
note that if you remove all access to the folder, images will not be displayed if you put them on your site with the <img> tag.
gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer
In apache, the default for blocking viewing files containing ".hta", which include HTAccess files is this code, which should be able to be formatted for anything you have
If you want files that are stored on that domain to be inaccessible from outside sources, not really sure.....maybe the Apache documentation may be able to help you there...Code:<FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch>
http://httpd.apache.org/docs/2.2
This is for the latest Apache release....2.2
If you want some hotlinking protection, use a php script that takes the name of the image and returns the actual image content. It shouldn't be hard. Next put all your files in a non web-accessible location. This way, you can log each access to each file, you can add a security code to check access is approved, you can had a cookie check, or even a basic HTTP_REFERRER check.
█ Xavier L | Community Public Relations Manager (Free Hosting Support)
█ Yes, my position is too cool to even exist!
█ How am I helping? Rate this post by clicking theicon below! (this is even better than "liking" a post)
█ Terms of Service | Acceptable Use Policy | x10Hosting Wiki
Couldn't you just put a blank index.html file?
@idontkno
If you know the name of the file, you could still access it, and alv4 doesn't want the directory to be accessed.
█ Xavier L | Community Public Relations Manager (Free Hosting Support)
█ Yes, my position is too cool to even exist!
█ How am I helping? Rate this post by clicking theicon below! (this is even better than "liking" a post)
█ Terms of Service | Acceptable Use Policy | x10Hosting Wiki