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
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
Related Q & A:
- How to Restrict Database for One User in SQL Server 2008 R2?Best solution by Database Administrators
- How do I make a python web program that is on a ubuntu server allow access to the server?Best solution by Yahoo! Answers
- How to restrict access to a sql server database from Azure?Best solution by Stack Overflow
- How do I access my e-mail in Outlook from a different computer?Best solution by Yahoo! Answers
- How do I enable cookies on my web browser?Best solution by Ask.com old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.