I'm having trouble with mod_rewrite. There's a broken external link to my site that looks something like this:
http://www.example.com/foo/page?myparam=AB/some-garbage.asp?bar=123
I'm trying to create a mod_rewrite rule to fix it (delete the last slash and everything after it). I've tried various things like:
RewriteCond %{QUERY_STRING} myparam=AB/ [NC] RewriteRule (myparam=AB.*) myparam=AB [L,R]
I have this rule at the top of the rule list, but I get a "Forbidden you don't have access to /foo/page on this server" error. If I delete the last "?" and everything after that from the URL, then the handler for this URL has a parameter of myparam with a value "AB/some-garbage.asp".
I've also tried REQUEST_URI and THE_REQUEST but nothing seems to rewrite this URL. Help please?