View Single Post

  #4 (permalink)  
Old 07-03-2003
Joachim Ring
 
Posts: n/a
Default Re: rewrite results not as expected

> i am testing an example ruleset from the rewrite guide but the log does not
> show what i expected to see.
>
> rule
>
> RewriteEngine on
> RewriteMap hosts-deny txt:/home/domain/domain1/logs/.hosts.deny
> RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR]
> RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND
> RewriteRule ^/.* - [F]
>
> extract of log shows
>
> cache lookup OK: map=hosts-deny[txt] key=62.252.224.5 -> val=
> RewriteCond: input='NOT-FOUND' pattern='!=NOT-FOUND' => not-matched
> cache lookup OK: map=hosts-deny[txt] key=62.252.224.5 -> val=
> RewriteCond: input='NOT-FOUND' pattern='!=NOT-FOUND' => not-matched
>
> now i expected second condition to input key with remote_host
> *inktomi2-lee.server.ntl.com* not the remote_addr.


i suspect that you're lacking a HostnameLookups On clause in your
setup. it defaults to off since apache 1.3 and then there's no
symbolic name for clients available. beware though that this will add
latency to your pages and load to your network & server - so only use
it if absolutely necessary.

joachim