[MAGNOLIA-2136] Public instance: different error pages for different virtualhost Created: 13/May/08  Updated: 23/Jan/13  Resolved: 19/Aug/09

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 3.5.4
Fix Version/s: 4.1.1

Type: Improvement Priority: Major
Reporter: Fabrizio Giustina Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MAGNOLIA-1565 Allow error pages (401,404,500 etc,et... Closed
is related to MAGNOLIA-2132 One Magnolia to rule them all Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Given that there is no real support for defining error pages in magnolia, we are anyway using the default error page mapping in web.xml in order to forward to magnolia-managed pages in case of 404 or errors.
If we think about serving different websites on a single public magnolia instance we should probably also find a way of defining different error pages for different virtualhosts.



 Comments   
Comment by Simon Goodchild [ 15/May/08 ]

This would also be a useful function for the core system, even when not using vitualhosts, so we should make it generic enough to cope with a single site - maybe a "default" entry in addition to a mapping for each virtualhost? As the app server config requires the error codes to be mapped to a physical file within the webapp, maybe we could have a generic error.jsp file within the core distribution which calls a 'errorDispatcher' class in turn would:

  • Identify the error code being flagged
  • Identify the hostname the http request was targeted at
  • Query a mapping table in the repository which points host+error to a specific page within the system
  • If there is no mapping for the given combination it uses the default entry for the error code
  • Then it redirects to the relevant URI

One issue would be whether we include these custom error pages within the actual site structure (would need to be hidden pages) or if we define some other node that they would all live under? Maybe we could have a convention of a site node called "error-pages" that is automatically ignored by the navigation tag to save having to set the hideInNav flag on every page?

Simon

Comment by Magnolia International [ 11/Sep/08 ]

Very related to MAGNOLIA-1565

Comment by Fabrizio Giustina [ 19/Aug/09 ]

This is now solved by MAGNOLIA-2846

you can simply setup a mapping like /errors/404.html in web.xml and then configure a HostBasedVirtualURIMapping to forward to real pages according to the request host

Generated at Mon Feb 12 03:33:46 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.