57 Working with WebRoots

back to WebCenter Sites Help

The WebRoot is used to control how the vanity URL is interpreted. WebRoots are like assets. After it is configured, a WebRoot must be published to the destinations for it to work in delivery system.

WebRoots come in two forms: absolute and relative. An absolute WebRoot must contain the entire URL prefix (including host and port information), it may also optionally contain a PATH prefix, it is unique to every server. A relative WebRoot contains only information related to the PATH and does not contain any information on the host or port. Both URLs are handled identically by WebCenter Sites; however, with relative WebRoot only a single WebRoot is required across multiple environments, for instance development, staging, and production environments. With absolute WebRoot each of these environments will have unique WebRoot.

To eliminate this limitation, the concept of VirtualRoot is supported. Using VirtualRoot requires setting an environment identifier (sites.environment) in the wcs_properties.json file to identify that they are valid for the given environment; if the parameter is missing then the WebRoot is used. It is important to determine and understand the types of WebRoots as you can have reason to have both absolute and relative roots defined at the same time.

The following table lists the advantages and disadvantages of these types of WebRoots.

Table 57-1 Advantages and Disadvantages of WebRoot Types

WebRoot Type Advantages Disadvantages

Absolute WebRoot

  • Full URL opens to the Content Contributor

  • A unique URL is required for every environment.

  • Virtual roots require setting a WebCenter Sites property.

  • Difficult to test vanity URLs before publishing.

Relative WebRoot

  • Single WebRoot works across all Systems

  • Vanity URLs can be easily tested before publishing

  • Content Contributors do not see the full URL, only the Path.

  • May require additional steps in rewriting the URL.

Combination

  • Full URL opens to the Content Contributor

  • Single WebRoot works across all Systems

  • Vanity URLs can be easily tested before publishing

  • More URLs are present and must be stored/published.

  • Content contributors will see both relative and absolute WebRoot URLs. Since there are more URLs it can be confusing to the Content Contributor.