Can I restrict which members can access the Files?

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.

  • Answer:

    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"

gansatan... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

See The Manual of Apache use .htaccess for that To get more over .htaccess Visit this URL 127.0.0.1/manual Alok Tiwari

mralokkp

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.

Darmawan W. Anandita

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.