Whenever a request occurs for URL mapping, the site ID must be associated with the URL. URL patterns are based upon site context. Sites contain site IDs and site attributes that are accessed by siteContext
objects. In turn, these objects are managed by the SiteContextManager
component. The SiteContextPipelineServlet
handles incoming requests and determines their SiteContext
. For each request, the siteContext
is set using the siteContextRuleFilter
, which uses the URLPatternMatchingRuleFilter
to map URLs to site IDs.
This filter determines the site ID by referring the URL against the configured URL map property. If no match is found, the URL is passed to the SiteURLManager.getSiteIdForURL
method.
By default, the URLPatternMatchingRuleFilter
is enabled. The enableSimpleAlgorithm
property enables the algorithm that matches the URL against the URL map. The enableSiteURLManagerAlgorithm
property performs the more complex algorithm that matches the values generated from the Site Repository.
The URLPatternMatchingRuleFilter
also checks if the associated Web application has the atg.multisite.URLPatternMatchingEnabled
parameter set. By default, this parameter is set to true
. If set to false
, the URLPatternMatchingRuleFilter
will not execute.
Ensure that the URLPatternMatchingRuleFilter
is enabled in your URL mapping properties file and your Web application web.xml
file.
The following is an example of a configuration of a URL map:
$class=atg.multisite.URLPatternMatchingRuleFilter urls=\ /webapps/site1App=site1,\ /webapps/site4App=site4,\ company.com=site7,\ company.com/webapp8=site8 siteURLManager=/atg/multisite/SiteURLManager enabled=true enableSimpleAlgorithm=true enableSiteURLManagerAlgorithm=true
The following is an example of a web.xml
file;
<web-app> ... <context-param> <param-name>atg.multisite.URLPatternMatchingEnabled</param-name> <param-value>false</param-value> </context-param> ... </web-app>
For additional information on site context, the SiteContextPipelineServlet
and the URLPatternMatchingRuleFilter
, refer to the ATG Platform Programming Guide.