Issue
I have another question:
when i write localhost/folder/file.txt
into browser, it opens and show the content of file.txt.
But I want make this file readable only by PHP, not by browser.
I tried everything with chmod
but it doesn't work. Is it possible to do that?
Thanks
Solution
You could refuse access to the .txt
extension.
.htaccess
# prevent viewing of a specific file
<Files file.txt>
order allow,deny
deny from all
</Files>
# multiple file types
<FilesMatch ".(htaccess|htpasswd|ini|phps|fla|psd|log|sh|txt)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Answered By - Ron van der Heijden Answer Checked By - Marie Seifert (WPSolving Admin)