As previously described, detail view links are composed of two parts, the detail page itself and the content-specific part at the end. Conversely, any URL composed of a detail page and the content-specific URL name for a detail content may be potentially interpreted as a detail view link, so that the same detail content can be shown in different detail pages. Depending on how your system is configured, some of these combinations may be valid (i.e. resulting in the detail view being opened in your browser for the given URL) or invalid (resulting in an HTTP 404 status code).
Restricting possible detail page / detail content combinations can be useful for SEO purposes. Some search engines penalize duplicate content available under different URLs. Also, the XML sitemap generator in OpenCms uses the information whether a combination of detail page and detail content is valid to eliminate superfluous detail view links.
However, allowing the same content on different detail pages also has valid uses. For example, on a website with multiple sub-sections, you might want to have individual detail pages for news articles in each of the sub-sections, but also be able to show the news articles in the context of the main site.
As a minimum requirement, a detail page must actually be registered as the detail page for the type of the detail content somewhere in a sitemap configuration - otherwise the combination is invalid.
The validity of various combinations is further controlled by the following configuration options:
- The
<restrict-detail-contents>
option in WEB-INF/config/opencms-system.xml
(see the DTD).
This can be set to true
(which is the default value) or false
. If set to true
, any combination of a detail page located in a proper site (i.e. not the shared folder or /system/ folder) and a detail content in a different proper site, will be rejected as invalid.
- The "Prefer local detail pages" option in the sitemap configuration (.config). We already discussed how this option influences the generation of links. If this is enabled for a (sub-)site, then any combinations of detail contents in the subsite and detail pages not configured for the subsite will be rejected as invalid, but only if there actually are detail pages configured for the detail content's type in the subsite.
Note that this option is not inherited through levels of subsites; you have to configure it individually for subsites.
- The "Disallow detail contents from other (sub)sitemap" option in the sitemap configuration (.config). If this is set, then combinations of detail pages inside the subsite and detail contents outside of it will be rejected as invalid.