I'm using a .htaccess file and im using the following code to try and revoke access from text files:
<Files *.txt> order deny,allow deny from all </Files>
This does revoke access but not text files only. It also doesn't allow pictures to be shown on another page which is strange because the pictures aren't in the same directory and I don't use
BROWSER DISPLAYS FORBIDDEN PAGE WHAT ELSE WOULD IT SHOW?
preguntado el 27 de agosto de 11 a las 20:08
Deny rule applies directory-wise even if it's in a declaration block.
<Files> will therefore often fail.
The manual mentions
<FilesMatch> as the preferred alternative, and it often works with authorization statements. I wouldn't count on this however; I had trouble getting this to work with multiple sections and overrides.
A more advisable alternative is to use a RewriteRule:
RewriteRule .+\.txt$ - [FORBIDDEN,LAST]
Which is also easier to restrict the effect to the current directory.