how to restrict access to files over web browser on a Linux server?
How to restrict files which are in Linux server, I want to restrict these files when the user tries to access this files using web browser. for eg my file is under the folder /var/www/html/xyz folder. files under these folder should not be accessed using http://mysite/xyz/abc.htm where as i want this file to be used using my php file so that if i want to show to users, then I will include this file using php. thanks in advance.
Public Comments
- See The Manual of Apache use .htaccess for that To get more over .htaccess Visit this URL 127.0.0.1/manual Alok Tiwari
- if that file readable by your php script, that means that file also readable by anyone. if that file is a php file, why dont you just add a conditional line to check wheter its called directly by client's browser or through your php script. eg: if the referer not equal your php script then redirect to somewhere.
- First, web server has its own "root" directory, "webroot". Second, if you do not want to show listing of some subdirectory of the webroot, clear 'x' bit for this directory using chmod command.. For more details, see both apache manual and also "man chmod"
Powered by Yahoo! Answers