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....
Restrict online users to access folders
Moderator: General Moderators
- turbolemon
- Forum Commoner
- Posts: 70
- Joined: Tue Jul 14, 2009 6:45 am
- Location: Preston, UK
Re: Restrict online users to access folders
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).
Do this for each directory to disable the directory listing, or to deny all access for users you could do something like this:
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.
Code: Select all
<Directory /absolute/path/to/directory>
Options -Indexes
</Directory>Code: Select all
<Directory /absolute/path/to/directory>
Order Deny,Allow
Deny from All
</Directory>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.