tags:

views:

28

answers:

1

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.

A: 

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.

David Zaslavsky
Thanks, that helped. Though in order to make it work right I had to ditch the redirect and add a proxy flag.The rule ended up looking like:`RewriteRule (.*) "/index.php?" [P, L]`
CEich
Ah, silly me, I completely missed the fact that you had an external redirect in there. Anyway, glad it worked.
David Zaslavsky