It is possible to test for null but for "". So: RewriteCond %{HTTP:proxy} .+ RewriteRule .* - [F] Now works lik in mod_rewrite.