PDA

View Full Version : Virtual hosts and error pages


TinkerBell
11-13-2009, 02:58 PM
Hi everyone,

OUr provider says it is not posible to configure a error page per virtual host dus to the fact that Rasin redirects all errors to one page. Is that true? I find this hard to believe.

Anyone who can say how an error page per host can be configures will be very much appriciated.

Thanks,
TinkerBell

nam
11-13-2009, 06:54 PM
Your hosting provider is essentially saying that you can only have one error page per resin server, which is incorrect.

The error page is configured at the <web-app> level, so it's one error page per web-app. A virtual host can have multiple web-apps, therefore you can in fact have multiple error pages per virtual host.

http://caucho.com/resin-3.0/config/webapp.xtp#error-page
http://caucho.com/resin-3.1/doc/webapp-tags.xtp#error-page
http://caucho.com/resin/reference/webapp-tags.xtp#error-page

TinkerBell
11-13-2009, 07:29 PM
Thank you!!

michael.lowden
01-08-2010, 09:10 PM
I've got mine setup like this:

<web-app>
...
<error-page> <error-code>400</error-code> <location>/error.jsp?lang=HTML&amp;code=400</location> </error-page>
<error-page> <error-code>401</error-code> <location>/error.jsp?lang=HTML&amp;code=401</location> </error-page>
<error-page> <error-code>402</error-code> <location>/error.jsp?lang=HTML&amp;code=402</location> </error-page>
<error-page> <error-code>403</error-code> <location>/error.jsp?lang=HTML&amp;code=403</location> </error-page>
<error-page> <error-code>404</error-code> <location>/error.jsp?lang=HTML&amp;code=404</location> </error-page>
...
<error-page> <error-code>500</error-code> <location>/error.jsp?lang=HTML&amp;code=500</location> </error-page>
...
</web-app>
so ... YES, you can have multiple setup as you like. Mine is just a little fancy cause they all end up going to the same error.jsp page just with their own "context" for the error output.