In my Apache config I'd like to return 403 when a query string parameter contains a specific value. Everything works fine except when the client query string is encoded in hex. How do I get it to match without having to type out the literal hex string?
RewriteEngine On RewriteCond %{QUERY_STRING} mykey=myval [NC] RewriteRule .* - [F,L] Then test it:
# Works fine, returns 403 curl -I 'http://localhost/?mykey=myval' # Does not work, returns 200: curl -I 'http://localhost/?mykey=%6d%79%76%61%6c' curl -I 'http://localhost/?%6d%79%6b%65%79=%6d%79%76%61%6c' thx