...
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
( 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 |
---|
className | info.magnolia.virtualuri.mapping.DefaultVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
maps a virtual URI to a content path. This is the simplest and most common type.
( 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 |
---|
className | info.magnolia.virtualuri.mapping.RegexpVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
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 |
---|
className | info.magnolia.virtualuri.mapping.RotatingVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
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 |
---|
className | info.magnolia.virtualuri.mapping.HostBasedVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
forwards the request to a different URI depending on the requested host name. Javadoc resource link |
---|
className | info.magnolia.virtualuri.mapping.HostBasedRegexpVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
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 |
---|
className | info.magnolia.module.googlesitemap.config.mapping.SiteMapVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
compares source URI to names of sitemaps available in the googleSitemaps
workspace and prepends the prefix.
info.magnolia.multisite.mapping.*
Javadoc resource link |
---|
className | info.magnolia.multisite.mapping.MultiSiteRootVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
is a special class which specifies the root of a site if site matching returns null
. Javadoc resource link |
---|
className | info.magnolia.multisite.mapping.MultiSiteRegexpVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
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 |
---|
className | info.magnolia.module.googlesitemap.config.SiteMapVirtualUriMapping |
---|
renderType | asynchronous |
---|
|
info.magnolia.multisite.*
Javadoc resource link |
---|
className | info.magnolia.multisite.MultiSiteRootVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
Javadoc resource link |
---|
className | info.magnolia.multisite.MultiSiteRegexpVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
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 |
---|
rangeHigherVersion | 5.5.6 |
---|
className | info.magnolia.cms.beans.config.DefaultVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
Javadoc resource link |
---|
rangeHigherVersion | 5.5.6 |
---|
className | info.magnolia.cms.beans.config.RegexpVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
Javadoc resource link |
---|
rangeHigherVersion | 5.5.6 |
---|
className | info.magnolia.cms.beans.config.RotatingVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
Javadoc resource link |
---|
rangeHigherVersion | 5.5.6 |
---|
className | info.magnolia.cms.beans.config.HostBasedVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
Javadoc resource link |
---|
rangeHigherVersion | 5.5.6 |
---|
className | info.magnolia.cms.beans.config.HostBasedRegexpVirtualURIMapping |
---|
renderType | asynchronous |
---|
|
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 |
---|
className | info.magnolia.cms.core.AggregationState |
---|
renderType | asynchronous |
---|
|
.
Examples
Default
Forward from /winter2016
to /marketing/campaigns/winter2016
.
...