Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Absolute

    fromUri: /winter2016
    toUri: forward:https://www.example.com/marketing/campaigns/winter2016.html

The mappings registry

Mappings The mappings are delegated to a separate module ( virtual-uri ) through the  info.magnolia.virtualuri.VirtualUriFilter  class and are stored in their own registry ( VirtualUriRegistry ), which allows to reference each mapping also in YAML definition files. All virtual URI mappings can be located via the Definitions app no matter whether they come from JCR or a YAML file:

...

Advanced Tables - Table Plus
heading0
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse


Node name

Value

Mgnl f
<my-module>


Mgnl f
virtualUriMappings


Mgnl n
enterprise-edition


Mgnl p
class

info.magnolia.virtualuri.mapping.DefaultVirtualUriMapping

Mgnl p
fromUri

/ee

Mgnl p
toUri

forward:/enterprise-edition


Via YAML

((warning) Magnolia 5.5.6+) You can configure virtual URI mappings in a YAML definition file inside a light module folder:

...

class

required

Class that performs the mapping. See the section Mapping classes below.

fromUri

required

Pattern to match in the requested URI.

toUri

required

Concrete URI where the request is mapped to.

site

required (for the MultiSiteRegexpVirtualURIMapping MultiSiteRegexpVirtualUriMapping class)

Specifies the site that should be used for the mapping.

...

.

A catalog of mappings

For easier orientation, if you have to configure a lot of mappings, you can store them in folder-like structures rather than in one long flat list of mappings:

...