Site resolution rules
For multisite definition configuration details, see Multisite definition configuration. |
Site resolution rules ensure that Magnolia can properly assign a site for a given request. The Multisite module comes with a standard set of site resolution rules. The standard rules usually are sufficient.
If you change the site resolution rules, verify your changes on a test system before making any changes to your production environment. Errors in the site resolution rules can break your site. |
Rule configuration
The multisite site resolution rules are configured below the /modules/multisite/config/rules
node.
Folder or node | |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note that every rule contains one or more configured Matcher
classes.
Disabling the uri-starts-with-sitename
rule on the public instance
The uri-starts-with-sitename
rule is a cross-site-evaluation rule that enables you to access a site using its site-definition-name from another domain. This is desired and required on the author instance, which typically runs on a domain different from the domain(s) mapped to a site definition(s).
If you have two site definitions, this rule allows you to access site A from the domain which is mapped to site B. This is typically not desired on a public instance.
Disable the Add an additional voter AdminOnlyMatcher to the rule. This way you can use the same configuration on both the author and public instances. |
Folder, node or property | Value |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Matcher 0
is set by default in the uri-starts-with-sitename
rule.
Add
AdminOnlyMatcher
as a second matcher to ensure the rule is applied in the author instance
only.
Custom site resolution rules and matcher classes
You can write your own custom matcher classes to create new rules. The custom class should extend AbstractMatcher, which implements the RequestMatcher interface.