Versions Compared

Key

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

...

Info

Please be aware that with Magnolia 5.5.6+, the case of the fromUri and toUri properties has changed. The original pre-5.5.6 uppercase forms ( fromURI and toURI ) have been deprecated and will work only when used together with the deprecated classes.

A catalog of mappings

((warning) Magnolia 5.5.6+) 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:

...

  • info.magnolia.virtualuri.mapping.*
    • Javadoc resource link
      classNameinfo.magnolia.virtualuri.mapping.DefaultVirtualUriMapping
      renderTypeasynchronous
       maps a virtual URI to a content path. This is the simplest and most common type.
      ((warning) Magnolia 5.4.6+) If the URI starts with a dot ( . ), it is not taken as a wildcard anymore but the dot in fact is interpreted as dot. If you need a wildcard, use ? instead.
    • Javadoc resource link
      classNameinfo.magnolia.virtualuri.mapping.RegexpVirtualUriMapping
      renderTypeasynchronous
       allows you to specify a regular expression pattern that matches a sequence of characters. A regexp pattern can match a variety of URIs, which saves time and effort as you would otherwise have to create default mappings for each case. toUri can contain back references to the regexp matches.
    • Javadoc resource link
      classNameinfo.magnolia.virtualuri.mapping.RotatingVirtualUriMapping
      renderTypeasynchronous
       is an extension of RegexpVirtualUriMapping that allows rotation between different destination URIs. In order to rotate, toUri must contain an asterisk character * that will be replaced by a random integer between start (default is 1) and end minus one (default is 3). An additional property padding specifies the desired width of the string. Zeroes are added to the left of the integer to make all strings equally wide. Default width is 2.

    • Javadoc resource link
      classNameinfo.magnolia.virtualuri.mapping.HostBasedVirtualUriMapping
      renderTypeasynchronous
       forwards the request to a different URI depending on the requested host name.
    • Javadoc resource link
      classNameinfo.magnolia.virtualuri.mapping.HostBasedRegexpVirtualUriMapping
      renderTypeasynchronous
       combines the host-based and regex mappings, i.e. forwards the request to a different URI depending on the requested host name and allows you to specify a regular expression pattern that matches a sequence of characters.
  • info.magnolia.module.googlesitemap.config.mapping.*
    • Javadoc resource link
      classNameinfo.magnolia.module.googlesitemap.config.mapping.SiteMapVirtualUriMapping
      renderTypeasynchronous
      compares source URI to names of sitemaps available in the googleSitemaps workspace and prepends the prefix.
  • info.magnolia.multisite.mapping.* 
    • Javadoc resource link
      classNameinfo.magnolia.multisite.mapping.MultiSiteRootVirtualUriMapping
      renderTypeasynchronous
       is a special class which specifies the root of a site if site matching returns null
    • Javadoc resource link
      classNameinfo.magnolia.multisite.mapping.MultiSiteRegexpVirtualUriMapping
      renderTypeasynchronous
       adds a site condition to the mapURI check.  A mapping will only match the request if both the specified regular expression and the specified site match.

...

  • info.magnolia.module.googlesitemap.config.*
    • Javadoc resource link
      classNameinfo.magnolia.module.googlesitemap.config.SiteMapVirtualUriMapping
      renderTypeasynchronous
  • info.magnolia.multisite.*
    • Javadoc resource link
      classNameinfo.magnolia.multisite.MultiSiteRootVirtualURIMapping
      renderTypeasynchronous
    • Javadoc resource link
      classNameinfo.magnolia.multisite.MultiSiteRegexpVirtualURIMapping
      renderTypeasynchronous

With the introduction of the virtual-uri module in Magnolia 5.5.6, the following classes have been deprecated:

  • info.magnolia.cms.beans.config.*
    • Javadoc resource link
      rangeHigherVersion5.5.6
      classNameinfo.magnolia.cms.beans.config.DefaultVirtualURIMapping
      renderTypeasynchronous
    • Javadoc resource link
      rangeHigherVersion5.5.6
      classNameinfo.magnolia.cms.beans.config.RegexpVirtualURIMapping
      renderTypeasynchronous
    • Javadoc resource link
      rangeHigherVersion5.5.6
      classNameinfo.magnolia.cms.beans.config.RotatingVirtualURIMapping
      renderTypeasynchronous
    • Javadoc resource link
      rangeHigherVersion5.5.6
      classNameinfo.magnolia.cms.beans.config.HostBasedVirtualURIMapping
      renderTypeasynchronous
    • Javadoc resource link
      rangeHigherVersion5.5.6
      classNameinfo.magnolia.cms.beans.config.HostBasedRegexpVirtualURIMapping
      renderTypeasynchronous

Action prefixes

You can use these action prefixes:

Action prefixes

You can use these action prefixes:

  • forward hides the true target URL from the visitor. The URL that the user typed forward hides the true target URL from the visitor. The URL that the user typed in the browser address bar or the link they clicked remains visible. Forward is performed internally by the servlet. Any browser reload of the resulting page will repeat the original request, with the original URL.
  • redirect displays the true target URL in the address bar. It is a two-step process where the web application instructs the browser to fetch a second URL which differs from the original. A browser reload of the second URL will not repeat the original request but will rather fetch the second URL. Redirect is marginally slower than a forward since it requires two browser requests instead of one. A redirect returns HTTP status code 302 "found" to the client. While OK for human visitors, this method can be suboptimal from search engine optimization (SEO) viewpoint as search engines do not transfer the page rank assigned to the old URL to the new URL.
  • permanent 301 redirect is a search engine friendly option. In this case the HTTP response code is set to 301. Google and Yahoo! specifically endorse this type of redirection and Bing is following the trend. 301 redirect preserves your search engine ranking for the redirected page.

It is also possible to leave the action prefix out. A virtual URI mapping that does not have a prefix does not re-process the request. It just changes the current URI in the 

Javadoc resource link
classNameinfo.magnolia.cms.core.AggregationState
renderTypeasynchronous
 .

Examples

Default

Forward from /winter2016 to /marketing/campaigns/winter2016 .

...