URL site management rules generally assume that site URLs are differentiated by their domain names or context paths:
Domain Names: Each site has a unique domain name.
URL Context Paths: All sites share the same domain, and are differentiated by their URL context paths.
Note: While it is possible to mix URL context path and domain naming conventions in a single application, it is generally advisable to choose one convention and use it for all sites.
Domain Names
You can differentiate sites through unique domain names; request URLs are mapped to site IDs accordingly. This convention encompasses two approaches:
Sites differentiate themselves by domain names.
Sites differentiate themselves by subdomain names that share the same parent domain.
For example, you can differentiate three sites that specialize in different sports through their domain names:
www.baseball.com/ www.hockey.com/ www.basketball.com/
You can also differentiate these sites through their subdomain names:
www.baseball.sports.com/ www.hockey.sports.com/ www.basketball.sports.com/
Note: Production site URLs and additional URLs must not include protocols such as HTTP
or HTTPS
. Site Administration automatically removes protocols from user-entered data; however, if you directly update the site repository’s siteConfiguration
properties productionURL
or additionalProductionURLs
, make sure that the URLs written to these properties excludes protocols.
Domains versus Subdomains
You can rely on subdomains to differentiate sites, where all subdomains use the same parent domain. In this case, you configure the application server to set the host name in JSESSIONID cookies to the parent domain. Sharing the same session among different parent domains requires a different approach. For more information, see Sharing a Session Across Multiple Domains.
URL Context Paths
You can differentiate sites that share the same domain through their URL context paths. For example:
www.mysports.com/baseball www.mysports.com/hockey www.mysports.com/basketball
To handle this case, follows these steps:
Configure the production site URLs of different sites with unique paths. For example:
/baseball
,/hockey
, and so on.Configure each site to specify the context root of the content-serving web application.
Virtual Context Roots
You can configure multiple sites so they access the same web application. To do so, you set their production URLs to virtual context roots—that is, URL context paths that do not map directly to the actual content-serving web application. Instead, URL requests that contain the virtual context root are routed to the actual context root as set in the site configuration’s contextRoot
property.
For example, you might set the context root for several sites to /sportswhere
and set their production site URLs as follows:
/sportswhere/baseball /sportswhere/hockey /sportswhere/basketball
The following requirements for using virtual context roots apply:
In the properties file for
/atg/dynamo/service/VirtualContextRootService
, setenabled
totrue
.Configure application servers so URL requests that contain virtual context roots are redirected to the actual context root. For more information, see Configuring Virtual Context Root Request Handling later in this chapter.