httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lothar Krenzien <>
Subject Re: [users@httpd] redirect only if a URL does not exists
Date Wed, 23 Aug 2006 09:30:02 GMT

Hi Joshua,

What I saw are the following lines in the logfile :
initial (5) RewriteCond URI (-U) check: path=/conergy/ -> status=200
initial (4) RewriteCond: input='/conergy/' pattern='!-U' => not-matched
initial (2) rewrite '/conergy/' -> 'http://localhost/sunreader/'
initial (3) split uri=http://localhost/sunreader/ -> uri=http://localhost/sunreader/,
initial (2) forcing proxy-throughput with http://localhost/sunreader/
initial (1) go-ahead with proxy request proxy:http://localhost/sunreader/ [OK]
initial (2) init rewrite engine with requested uri /sunreader/
initial (3) applying pattern '^/(.*).do' to uri '/sunreader/'
subreq (2) init rewrite engine with requested uri /sunreader/
subreq (3) applying pattern '^/suntechnics/admin/(.*)$' to uri '/sunreader/'
subreq (1) pass through /sunreader/
initial (5) RewriteCond URI (-U) check: path=/sunreader/ -> status=200 <==
this URL doesn't work
initial (4) RewriteCond: input='/sunreader/' pattern='!-U' => not-matched

For me it looks like that Apache calls the URL that doesn't exist for now but gets 200 instead
of 4xx or 5xx back.
Maybe it's easier to explain what I want to do:

I have Apache HTTPD on port 80 and Tomcat on Port 8080.
Our customers call a URL like http://server/conergy/ or http://server/suntechnics/
This URL should changed by Apache to http://server/sunreader/ and is
done by a RewriteRule
The new URL should 'forwared' to Tomcat on Port 8080.
When Tomcat is offline (for example the service is not running) I want to display a customized
error-site which is (of course) located in the 

I know that I can define an ErrorDocument. But it doesn't seem to work. Don't know why. The
definition of the ErrorDocument looks like :
ErrorDocument 404 http://localhost/Portal_Update.php
But instead of that site only the standard error site is displayed.

I changed the rewrite rules a little bit:

# the offline document
 RewriteCond 	%{REQUEST_URI} !-U
 RewriteRule    ^/(.*).do  http://localhost/Portal_Update.php [R,L]

# portal
 RewriteRule ^/conergy/(.*).do$ http://localhost/sunreader/$ [R,L,P]
 RewriteRule ^/suntechnics/(.*).do$ http://localhost/sunreader/$ [R,L,P]

Now I get an 404 instead of 503. I included the P and R flag
But as just sayed I can't define a custom error document.

Thanks, Lothar

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message