I’m trying to figure out how I can deny users from looking at a text file but still access the file (read) with PHP? Is there a way to do this with htaccess?
EDIT: New to file security, I’m up for trying anything new!
I’m trying to figure out how I can deny users from looking at a
Share
You can do this easily by putting a .htaccess file in the folder you want to block. This contents of the .htaccess being
deny from all. Then your web server won’t serve up the pages, but you can still access them withfopen,file_get_contentsect.