Jump to content

[SOLVED] Force non-display of a file


mr_mind

Recommended Posts

Yes, that's quite right. Good rule! ;)

 

Something very close to this is usually included in the default Apache config. (see below)

I rechecked my own server logs and I must have expanded the rule at some point in the past and not noted the reason for the change. A good reminder to keep copious notes in one's http.conf when things are changed!.

 

The supplied default normally blocks only ".ht*" files so it is probably worth expanding. I have a funny feeling that this may be extended on an O/S dependent basis - perhaps having a wider scope in Linux?. I use Win32 which is probably more lax thus requring the rule to be expanded.

 

I tried the following shorter rule and this also seemed to work OK on Win32 banning ".*"

 

<Files ~ "^\.">
    Order allow,deny
    Deny from all
</Files>

 

Here's the default entry which it might pay others reading this to find/edit and implement using your rule...

 

#Apache default config
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

 

 

 

 

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.