Jump to content

Restrict Access to files...


Hazukiy

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.