[MAGNOLIA-2846] Easy configuration of different urimappings based on hostname Created: 17/Aug/09  Updated: 29/Apr/14  Resolved: 17/Aug/09

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
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-2849 Cache: cache keys based on host names... 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   

Having a different default page depending on the hostname is pretty common as a requirement, a new specific VirtualURIMapping implementation could help.



 Comments   
Comment by Fabrizio Giustina [ 17/Aug/09 ]

Added a new info.magnolia.cms.beans.config.HostBasedVirtualURIMapping.

Sample configuration copied from javadoc:

 [] virtualURIMapping
    [] default
     - class            info.magnolia.cms.beans.config.HostBasedVirtualURIMapping
     - fromURI          /
     - toURI            redirect:/.magnolia/pages/adminCentral.html
       [] hosts
        - 1             www.acme.com=forward:/acme/en/index.html
        - 2             www.acme.de=forward:/acme/de/index.html
Comment by Philipp Bärfuss [ 03/Sep/09 ]

Thanks for this. Next step to do (the base has been led by the link resolving re-factoring in 4.0):

  • rewrite the links (omit the obsolete path prefix like /acme/en/ if a page is accessed by using a certain host name)

We planed to solve that by using the site configuration of STK.

Comment by Richard Unger [ 29/Apr/14 ]

After looking over these solutions, I coded a solution by subclassing MultiSiteFilter.
Doing it in multisitefilter has several advantages:

  • you can serve error pages from the individual sites without having to add configuration per site.
  • one forward less happens while processing the request
    (virtual uri method has original request + 2 forwards, filter solution has orig request + 1 forward)

I will try to share the solution on the wiki.

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