Forum Moderators: phranque
/redirect?request=multimedia
Below is an example of a rule I'm testing with, but it just doesn't seem to be working. I've tried putting a backslash before the ? in the pattern match part and using the hex version of %3F as well. When I test I see in the access logs that it's giving a 502 error after a minute. Also enabled the rewrite log and I've included that below. It seems that it just keeps processing the rules because it's not properly pattern matching. Any help on this is much appreciated.
RewriteRule ^/redirect?request=multimedia [11.11.11.11...] [P,L,NE]
11.11.11.11 - - [04/May/2009:17:15:49 --0500] [11.11.11.11/sid#3001e920][rid#6089a298/initial] (2) init rewrite engine with requested uri /redirect
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '^/redirect.?request=multimedia' to uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '^/PA_1_ICGAQI420GTJ502LD4J3311GQ1/redirect/redirect(.*)'
to uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '^/PA_1_ICGAQI420GTJ502LD4J3311GQ1/DownloadContent(.*)' to
uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '^/redirectredirect(.*)' to uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '.?' to uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (4) RewriteCond: input='/redirect' pattern='^/ABCD/PA_1_BC1BQI42000K802N9R3F4
Q3000/redirect(.*)' => not-matched
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '^.*$' to uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (4) RewriteCond: input='' pattern='^[^:]*:([^;]+)' => not-matched
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (3) applying pattern '^/DRM(.*)' to uri '/redirect'
11.11.73.254 - - [04/May/2009:17:15:49 --0500] [11.11.72.30/sid#3001e920][rid#6089a298/initial] (1) pass through /redirect
RewriteCond %{QUERY_STRING} \?request\=multimedia
RewriteRule ^/redirect%1 [aaa.aaa.com...] [L,NE]
RewriteCond %{QUERY_STRING} &?request=multimedia&?
RewriteRule ^/redirect$ http://example.com/ABCD/PA_1_ICGAQI420GTJ502LD4J3311GQ1/MediaChannel? [R=301,L]
Because you said you wanted a "static URL" in your first post, I assumed that you want to drop the query string. If not, just take the question mark off the RewriteRule substitution URL.
The query string test will accept a query of "request=multimedia" or "foo=bar&request=multimedia" or "request=multimedia&foo=bar" or "quux=foo&request=multimedia&bar=closed" or any other query string containing "request=multimedia", as long as "request=multimedia" is properly bounded by ampersands if any other name/value pairs are present.
You may think of the "&?" subpatterns as "soft anchors." That is, if *any* character precedes or follows "request=multimedia", then it must be an ampersand. This prevents matches on, for example, "newrequest=multimedia" or "request=multimediareviews".
Jim
[edited by: jdMorgan at 5:34 am (utc) on May 6, 2009]
RewriteCond %{QUERY_STRING} [b]^r[/b]equest=multimedi[b]a$[/b]
Jim
It is likely that you would like a 404 status in the HTTP header, and it is even more likely that it actually returns a blank template page with a 200 OK status code at present.