use basic auth based on query_string
===

I'm trying to protect urls containing a specific string:

    RewriteCond %{QUERY_STRING} foo
    RewriteRule - [E=NEED_AUTH:1]
    Options -Indexes
    AuthType Basic
    AuthUserFile /etc/apache2/.htpasswd
    Order allow,deny
    allow from all
    satisfy any
    deny from env=NEED_AUTH
    Require valid-user

I suppose this should bring up the authentication dialog when loading

    index.php?format=foo

but it doesn't work. I tried several other RewriteConds like for example

    RewriteCond %{QUERY_STRING} format=foo
    RewriteCond %{QUERY_STRING} ^format=foo$

with no luck. Using

    RewriteLog "/var/log/apache2/rewrite.log"
    RewriteLogLevel 3

doesn't log anything.


Any suggestions? :)
    
