You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Noah <si...@onastick.net> on 2005/06/04 02:10:06 UTC

Re: [users@httpd] RewriteRule question

On Tue, May 31, 2005 at 12:33:35PM -0700, Gary W. Smith wrote:
> I have also tried 
> 
> RewriteEngine on
> RewriteCond %{HTTP_REFERER} ^$
> RewriteCond %{HTTP_REFERER} !^http://(10\.20\.30\.40)/.*$ [NC]
> RewriteRule ^/restricted/.+ - [F]
> 
> And 
> 
> 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.

For debugging (and *only* for debugging; do not do this on a production
server), set:

RewriteLog /path/to/rewrite.log
RewriteLogLevel 9

mod_rewrite's debug logging is quite verbose, and should help you
isolate the issue. As an aside, the parentheses around the IP address in
your regex are not needed, and may result in a slight performance hit.

--n

-- 
When the need arises -- and it does -- you must be able to shoot your own 
dog. Don't farm it out -- that doesn't make it nicer, it makes it worse.
                                        --Robert A. Heinlein

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org