Re: [users@httpd] redirect only if a URL does not exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joshua,

What I saw are the following lines in the logfile :
...
initial (5) RewriteCond URI (-U) check: path=/conergy/Welcome.do -> status=200
initial (4) RewriteCond: input='/conergy/Welcome.do' pattern='!-U' => not-matched
initial (2) rewrite '/conergy/Welcome.do' -> 'http://localhost/sunreader/Welcome.do?mandant=conergy'
initial (3) split uri=http://localhost/sunreader/Welcome.do?mandant=conergy -> uri=http://localhost/sunreader/Welcome.do, args=mandant=conergy
initial (2) forcing proxy-throughput with http://localhost/sunreader/Welcome.do
initial (1) go-ahead with proxy request proxy:http://localhost/sunreader/Welcome.do [OK]
initial (2) init rewrite engine with requested uri /sunreader/Welcome.do
initial (3) applying pattern '^/(.*).do' to uri '/sunreader/Welcome.do'
subreq (2) init rewrite engine with requested uri /sunreader/Welcome.do
subreq (3) applying pattern '^/suntechnics/admin/(.*)$' to uri '/sunreader/Welcome.do'
subreq (1) pass through /sunreader/Welcome.do
initial (5) RewriteCond URI (-U) check: path=/sunreader/Welcome.do -> status=200 <== this URL doesn't work
initial (4) RewriteCond: input='/sunreader/Welcome.do' 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/Welcome.do or http://server/suntechnics/Welcome.do
This URL should changed by Apache to http://server/sunreader/Welcome.do?mandant=xxx 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/$1.do?mandant=conergy [R,L,P]
 RewriteRule ^/suntechnics/(.*).do$ http://localhost/sunreader/$1.do?mandant=suntechnics [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:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux