Hazukiy Posted April 7, 2013 Share Posted April 7, 2013 Hi, I was wondering but how would I make it so that people when on my site can't access certain files like 'footer.php' which is used as an include in PHP like so: include 'footer.php'; Basically I just want it so if the person tries to access domain.com/footer.php it'll return an error. Thanks. Link to comment https://forums.phpfreaks.com/topic/276646-restrict-access-to-files/ Share on other sites More sharing options...
mac_gyver Posted April 7, 2013 Share Posted April 7, 2013 put the "included" files into a folder that doesn't permit any web access. there's two ways of doing that - 1) put the folder outside, rather than inside, your web root folder or 2) put the folder inside your web root folder and put a .htacess file into the folder that deny's all http requests to the files in that folder. search for "htaccess deny all" to find out how. Link to comment https://forums.phpfreaks.com/topic/276646-restrict-access-to-files/#findComment-1423398 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.