Re: .htaccess deny question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 24, 2010 at 5:22 PM, Industrial Blue
<industrialblue@xxxxxxxxx> wrote:
> Here you are:
>
> order allow,deny
> deny from 12.3.80
> deny from 12.3.81
> ...
> deny from *n\.example.com
> ErrorDocument 403 "This IP is blocked."
> allow from all
>
>
> That's it!  Thanks for any help.
>

That is incorrect syntax. It will be looking for an explicit host name
of '*n\.example.com'. That sort of wildcard expansion is not supported
by Allow/Deny directive, see here for docs:

http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#allow

If you need to do this sort of access checking (seems a bit nuts to me
- you can escape it by changing your dns name?), then you must follow
the example in the docs of setting an environment variable to denote
whether access should be allowed, and then using that environment
variable to allow/deny access.

Eg:

SetEnvIf Remote_Host *n\.example\.com bad_src_server=1
<Location />
  Order deny,allow
  Deny from env=bad_src_server
</Location>

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux