Page 1 of 1

How to make a file/folder as forbidden (http status - 403)

Posted: Sun Jul 09, 2006 11:46 pm
by asha
I have a php program which reads data from a file. [The data file is in a different folder]. In this scenario, how will i get 403 Error (Forbidden) while executing the program/reading the data from the file.

Thanks..

Posted: Sun Jul 09, 2006 11:58 pm
by Benjamin
The folder doesn't have execute (traverse) permissions, or the file doesn't have read permissions for the user the script is executing under.

Research

Code: Select all

chmod();

Posted: Mon Jul 10, 2006 3:22 am
by Jenk
Not sure if this will cause any problems as I haven't tried it myself, but in the directory you wish to protect, create (or modify existing) .htaccess file:

Code: Select all

<Directory /path/to/dir>
    Order Deny,Allow
    Deny from all
</Directory>