hi everyone .. i have just finished developing a web application i hope to put on the www very soon. however my application has various folders that i dont want the public to access directly through a URL for example the images, config and includes folder which contain database and php scripts containing classes and functions and so on..
secondly in the includes folder for example i have a file called functions.php. so when someone accesses www.mysitename.com/includes/functions.php, i want a message to be output saying file cannot be accessed.

can anyone please tell me how i can go about this. thank you

8 Years
Discussion Span
Last Post by !Unreal

certain files can be placed above the public_html directory. You could put all your scripts there (php can access areas above public). However, you can't access files above public through html, like a links, css links, js script sources, images sources. For the latter, use .htaccess.


I wouldnt recomend doing this through PHP, I would use .htaccess.

Just search on Google, there are loads of tutorials on it :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.