So I have some particular variables that mess up the content management system I’m using.
While I debug the code, I’d like to redirect requests with these particular variables back to the index page, but without any query string.
Here’s my rule:
RewriteCond %{QUERY_STRING} option\=com\_aicontactsafe\&sTask\=captcha
RewriteRule (.*) "/index.php" [R=301, L]
At this point it is simply writing the file path to index.php after the HTTP_HOST.
This gives a 403, but is not quite what I wanted.
Redirect to
/index.php?instead of just/index.php. Normally mod_rewrite doesn’t touch the query string, unless you give it a new query string to replace the old one with.