httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Forsberg <forsb...@unit.liu.se>
Subject [users@httpd] Problem rewriting and proxying /login.wcap? into /login.wcap
Date Thu, 12 Sep 2002 10:53:13 GMT
Hi!

I have a stupid closed-source application that's trying to access
another stupid closed-source application using WCAP. Now, given the
latter fact, some of you can probably figure out what stupid closed-source
application I'm talking about in the second case :).

Anyway, the thing is that the application is doing a request like
this:

--snip--
POST /login.wcap? HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: kunlun.student.liu.se
Content-Length: 48
Cache-Control: no-cache

user=erifo764&password=xxxxxxxx&fmt-out=text/xml
--snap--

Note the '?' after /login.wcap - that's the important thing here.

This gives incorrect results - i.e., the server doesn't understand the
query when there is a '?' after /login.wcap 

A correct request, looking like this:

--snip--
POST /login.wcap HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: kunlun.student.liu.se
Content-Length: 48
Cache-Control: no-cache

user=erifo764&password=xxxxxxxx&fmt-out=text/xml
--snap--

..gives back a bunch of XML, which is what I want.

Of course, the correct thing is to fix the application - I'm working
on getting "them" to fix that, but as a short-term solution I'd like
to rewrite the URL before it goes into the server.

I already have a proxying apache in front of the server in order to
get HTTPS (of course, the stupid software doesn't fix https in a
correct fashion), so I thought I could add some rewrite rules to get a
correct request into the server.

I'm trying to use mod_rewrite in Apache 1.3.26, using something like
this:

RewriteEngine on
RewriteRule ^/login.wcap\?$ http://kunlun:80/login.wcap [P,L]
RewriteRule ^/(.*) http://kunlun:80/$1 [P,L]
RewriteLog /service/proxy-calendar/logs/rewrite.log

Which doesn't work - Apache doesn't seem to se the '?' and applies the
second rule, just sending the whole request to the backend.

I also tried this:

RewriteEngine on
RewriteRule ^/login.wcap$ http://kunlun:80/login.wcap [P,L]
RewriteRule ^/(.*) http://kunlun:80/$1 [P,L]
RewriteLog /service/proxy-calendar/logs/rewrite.log

Which makes apache recognize the /login.wcap request, but it still
sends the '?' into the backend.

Any ideas on how to solve this?

Regards,
\EF
--


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message