This is a discussion on Spot the mistake within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi This rewrite should work, but it isn't. Can anyone spot what the problem is? RewriteRule /someAPIServlet\?command=createaccount$(.*) /...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
This rewrite should work, but it isn't. Can anyone spot what the problem is? RewriteRule /someAPIServlet\?command=createaccount$(.*) /someServlet?command=createaccount$1/ [R] Instead of a 302 I get a 200 OK response. Afaik, the Rewrite rule is syntactically correct. +++GET 227+++ GET /someAPIServlet?command=createaccount&cageid=104547 8&country=100¤cy=100&title=Mr&firstname=Blah &lastname=DeeBlah&street1=6Highst&street2=Blahstow n&street3=Blahville&DistrictTown=Blahtown&DOB=1978 0401&Postalcode=sl73le&Primaryphone=161561611&AltP hone=156151115&Email=vcttesstt82@leisurecash.net HTTP/1.1 Host: test.yada.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Cookie: Lang=1; JSESSIONID=e--Gn8QQTrM8 Connection: keep-alive +++RESP 227+++ HTTP/1.1 200 OK Date: Sat, 28 May 2005 11:56:52 GMT Server: Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7b Pragma: no-cache Vary: Accept-Encoding Content-Encoding: gzip P3P: policyref="http://test.yada.com/w3c/p3p.xml", CP="ALL DSP COR CURa ADMa DEVa TAIa OUR BUS IND UNI COM NAV INT" Transfer-Encoding: chunked Content-Type: text/plain; charset=UTF-8 +++CLOSE 227+++ If anyone can spot why this isn't working, i'd appreciate the tip. Cheers |
|
|||
|
On 28 May 2005 05:03:24 -0700,
<asil75@gmail.com> wrote: > Hi > > This rewrite should work, but it isn't. Can anyone spot what the > problem is? > > RewriteRule /someAPIServlet\?command=createaccount$(.*) > /someServlet?command=createaccount$1/ [R] > > Instead of a 302 I get a 200 OK response. Afaik, the Rewrite rule is > syntactically correct. "$(.*)" means End-of-Line followed by arbitrary text. This is obviously incorrect. --n |
|
|||
|
On 28 May 2005 05:03:24 -0700, in comp.infosystems.www.servers.unix,
asil75@gmail.com wrote: >Hi > >This rewrite should work, but it isn't. Can anyone spot what the >problem is? > > RewriteRule /someAPIServlet\?command=createaccount$(.*) >/someServlet?command=createaccount$1/ [R] > UNTESTED It is not clear if the $ follow "createaccount" is supposed to be there as an actual character in the pattern. If so, include it below and escape it (\$). The QSA flag in the second option may be superfluous. The first option parses the query string. The second uses the fact that the query string is unchanged to just match on it as a condition. RewriteCond %{QUERY_STRING} ^command=createaccount(.*) RewriteRule ^/someAPIServlet$ /someServlet?command=createaccount%1/ [R] or RewriteCond %{QUERY_STRING} ^command=createaccount RewriteRule ^/someAPIServlet$ /someServlet [R,QSA] HTH, Jim |