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. Quote Link to comment https://forums.phpfreaks.com/topic/276646-restrict-access-to-files/ Share on other sites More sharing options...
Solution mac_gyver Posted April 7, 2013 Solution 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. Quote Link to comment https://forums.phpfreaks.com/topic/276646-restrict-access-to-files/#findComment-1423398 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.