Hi,
We have created some custom error handler pages (in /apps/sling/servlet/errorhandler/) and they are being served as expected when we hit our publish instances directly (e.g. http://example.com:4503/foo).
However when we access a web site through the dispatcher, the dispatcher does not use our custom pages and renders the standard 404 error page.
Is there a way to configure the dispatcher to use our custom error pages as well?
Thanks.
Solved! Go to Solution.
if you want to get a default page on hitting a URL without file extension(http://example.com:4503/foo instead of http://example.com:4503/foo/index.html) first you must configure the sling:redirect (please refer http://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html)
Please find attached screenshot showing what happens when you hit homepage of geometrix .. take notice ..sling:redirect=true and sling:resourceType=foundation/components/redirect
Instead of redirect if you want to display error page ..
here are some notes ..
http://www.slideshare.net/gummadal/the-secret-life-of-a-dispatcher
http://dev.day.com/docs/en/cq/current/developing/customizing_error_handler_pages.html
http://httpd.apache.org/docs/2.2/custom-error.html
Use of ErrorDocument
is enabled for .htaccess files when the AllowOverride
is set accordingly.
Here are some examples...
ErrorDocument 500 /cgi-bin/crash-recover
ErrorDocument 500 "Sorry, our script crashed. Oh dear"
ErrorDocument 500 http://xxx/
ErrorDocument 404 /Lame_excuses/not_found.html
ErrorDocument 401 /Subscription/how_to_subscribe.html
The syntax is,
ErrorDocument <3-digit-code> <action>
where the action can be,
Views
Replies
Total Likes
if you want to get a default page on hitting a URL without file extension(http://example.com:4503/foo instead of http://example.com:4503/foo/index.html) first you must configure the sling:redirect (please refer http://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html)
Please find attached screenshot showing what happens when you hit homepage of geometrix .. take notice ..sling:redirect=true and sling:resourceType=foundation/components/redirect
Instead of redirect if you want to display error page ..
here are some notes ..
http://www.slideshare.net/gummadal/the-secret-life-of-a-dispatcher
http://dev.day.com/docs/en/cq/current/developing/customizing_error_handler_pages.html
http://httpd.apache.org/docs/2.2/custom-error.html
Use of ErrorDocument
is enabled for .htaccess files when the AllowOverride
is set accordingly.
Here are some examples...
ErrorDocument 500 /cgi-bin/crash-recover
ErrorDocument 500 "Sorry, our script crashed. Oh dear"
ErrorDocument 500 http://xxx/
ErrorDocument 404 /Lame_excuses/not_found.html
ErrorDocument 401 /Subscription/how_to_subscribe.html
The syntax is,
ErrorDocument <3-digit-code> <action>
where the action can be,
Views
Replies
Total Likes
Hi,
An easy way would be to store the custom error pages in the dispatcher server then configure Apache to point 404 pages to the error page.
Views
Replies
Total Likes
I am looking for a way to serve them from the publish instance and maybe cache them in the dispatcher. Is there a way to do this?
Views
Replies
Total Likes
You can configure the ErrorDocument part of your virual host in the Apache HTTPD configuration
ErrorDocument 500
/apps/sling/servlet/errorhandler/500.html
ErrorDocument 404 /apps/sling/servlet/errohandler/404.html
See http://httpd.apache.org/docs/2.2/mod/core.html#errordocument
/O
Views
Replies
Total Likes
Hi,
I tried using the ErrorDocument in the vhost file in disptacher which is pointing to the error pages(/content/abc/404.html, /content/abc/500.html) for 500, 404 respectively.But when we see the Status code in network tab, we see as 200. But we need exact status code,as 404 or 500. I tried using <%slingResponse.setStatus(404);%> in the jsp of the page component of /content/abc/404.html. But it shows error like ,shown in the pic below , can anyone suggest on this?
i have a multilingual site in same domain, my requirement is to redirect different error pages for different site.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies