[opencms-dev] Custom error pages for some sites
Pavel Peringer
pavel.peringer at qbizm.cz
Fri May 19 12:41:17 CEST 2006
Hello
I would like to have custom error pages for each site. These pages are
located in site module dir "/system/modules/[site_name]/error-pages". In
handle404.html I would like to recognize the site an error comes from
and include page from corresponding errorpages dir. But I can not find
out which site error comes from because the is no info in request about
it. Only the missing requested file in "site format" - /any_file without
"context" - the original site.
In OpenCmsServlet.openErrorHandler() is set the error code
req.setAttribute(CmsRequestUtil.ATTRIBUTE_ERRORCODE, new
Integer(errorCode));
From JSP request I can get "javax.servlet.error.request_uri" again
without siteRoot information.
I use Apache proxing and so I get from request.getHeader("Host") String
"127.0.0.1" and can not display for web user this "ugly" link to site
home page "http://127.0.0.1/index.html" for its site.
Maybe it should be good add the SiteRoot information to the handler
request or how can I solve this problem in "OpenCms" way?
On Opencms Forum there was an idea of redirect from /system/handler404
to /error404.html which should redirect back to the "original" site and
customize this page.
By this way the web user get from his missing URL to /error404 URL. I
would preffer the URL stay same and only generate error "content" into
missing page..
Thanks a lot
Pavel Peringer
--
Pavel Peringer Qbizm technologies, a.s.
programator ... the art of software.
____________________________________________________________________
www.qbizm-technologies.cz www.qbizm.cz www.qbizm-services.cz
More information about the opencms-dev
mailing list