httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Fleet" <afl...@digerati.com.au>
Subject [users@httpd] Rewriting to a servlet
Date Wed, 11 Feb 2004 05:48:26 GMT
Hi folks,

we're running Apache on a Cobalt machine, which serves servlets using
Tomcat.

We have a servlet

http://payment.digerati.com.au/pay/servlet/paymentengine.page.Welcome?siteId
=1

which runs fine. I would like to set up a rewrite rule so that the following
URL is rewritten to the URL above.

http://payment.digerati.com.au/test/paymentengine.page.Welcome?siteId=1

An excerpt from my httpd.conf follows (note the last rule):

RewriteEngine On
RewriteLog /home/digerati/logs/rewrite_log
RewriteLogLevel 6
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteCond %{DOCUMENT_ROOT}            !-d
RewriteRule .*                          http://%1:444/error/forbidden.html
[L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/admin/?$                  http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/siteadmin/?$              http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/personal/?$               http://%1:444/login.php [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/login/?$                  http://%1:444/login.php [L,R]

RewriteRule ^/test/(paymentengine\..*)$ /pay/servlet/$1 [PT]

Looking at the log file, it seems to try to perform the rewrite ok, yet I
still end up with "this page cannot be found"

Here's the rewrite_log excerpt:

203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (2) init rewrite
engine with requested uri /test/paymentengine.page.Welcome
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '^/(.*)' to uri '/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (4) RewriteCond:
input='payment.digerati.com.au' pattern='!^202.62.62.6(:80)?$' => matched
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (4) RewriteCond:
input='payment.digerati.com.au' pattern='!^payment.digerati.com.au(:80)?$'
=> not-matched
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '.*' to uri '/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (4) RewriteCond:
input='payment.digerati.com.au' pattern='^([^:]+)' => matched
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (4) RewriteCond:
input='/home/.sites/112/site7/web' pattern='!-d' => not-matched
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '^/admin/?$' to uri '/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '^/siteadmin/?$' to uri '/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '^/personal/?$' to uri '/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '^/login/?$' to uri '/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (3) applying
pattern '^/test/(paymentengine\..*)$' to uri
'/test/paymentengine.page.Welcome'
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (2) rewrite
/test/paymentengine.page.Welcome -> /pay/servlet/paymentengine.page.Welcome
203.55.204.4 - - [11/Feb/2004:16:45:14 +1100]
[payment.digerati.com.au/sid#843bd1c][rid#84562a4/initial] (2) forcing
'/pay/servlet/paymentengine.page.Welcome' to get passed through to next API
URI-to-filename handler

Can anyone point me in the right direction?

Cheers,

Adam Fleet.


---------------------------------------------------------------------
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