Page 1 of 1
Restrict online users to access folders
Posted: Mon Aug 03, 2009 2:05 am
by baby@qute
Hi to all
Can some pls help me
I have build a website in php connected to myaql database
now i want to restrict the users to access the public_html folder in which i have many more folders like include,images, etc.. etc... i donot want the users online to directly access these folders
Thanks in Advances....
Re: Restrict online users to access folders
Posted: Mon Aug 03, 2009 5:19 am
by turbolemon
In what way do you want to deny them access? If using apache, turn off directory listings using your apache .conf file, or .htaccess file within the directory (if allowed).
Code: Select all
<Directory /absolute/path/to/directory>
Options -Indexes
</Directory>
Do this for each directory to disable the directory listing, or to deny all access for users you could do something like this:
Code: Select all
<Directory /absolute/path/to/directory>
Order Deny,Allow
Deny from All
</Directory>
This will deny ALL requests for files which are located within that directory, including images embedded in pages and other content. This would be suitable for your includes directory but not so for images directory (unless you plan to supply the images using other means).
To use the above in .htaccess, you need to omit the <directory> tags surrounding the commands.
See
http://httpd.apache.org/docs/1.3/mod/co ... #directory for more information.