PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > comp.info.servers.unix > Spot the mistake
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.info.servers.unix Web servers for UNIX platforms.

Spot the mistake

Réponse
 
LinkBack Outils de la discussion
Vieux 28/05/2005, 13h03   #1
asil75@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Spot the mistake

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&currency=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
: 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

  Réponse avec citation
Vieux 07/06/2005, 20h23   #2
Nisse Engström
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Spot the mistake

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
  Réponse avec citation
Vieux 07/06/2005, 21h59   #3
Jim Hayter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Spot the mistake

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h16.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07914 seconds with 11 queries