httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary W. Smith" <>
Subject Re: [users@httpd] RewriteRule question
Date Tue, 31 May 2005 19:33:35 GMT
I have also tried 

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^$
RewriteCond %{HTTP_REFERER} !^http://(10\.20\.30\.40)/.*$ [NC]
RewriteRule ^/restricted/.+ - [F]


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(10\.20\.30\.40)/.*$ [NC]
RewriteRule ^/restricted/.+ - [F]

As well.  I think the the first conditional like should have been removed
but I left it there during some of the test cases.

Still it doesn't work.


On 5/31/05 11:46 AM, "Arne Heizmann" <> wrote:

> Gary W. Smith wrote:
>> I have the following rule in place:
>> RewriteEngine on
>> RewriteCond %{HTTP_REFERER} !^$
>> RewriteCond %{HTTP_REFERER} !^http://(10\.20\.30\.40)/.*$ [NC]
>> RewriteRule ^/restricted/.+ - [F]
> So suppose I go in with an empty referrer. The first condition is false.
> Therefore the rule is not applied, therefore I am granted access.
> Perhaps you meant ^$ rather than !^$. But notice that testing for empty
> referrer is redundant, because the second condition will already catch
> it. So I guess it's enough to make that your only condition.
> Timwi

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message