An Adobe Experience Manager project needs to deny all JSON and HTML requests under the /path1 and /path2 context paths.
/path1
/path2
Which configuration will work?
In the AEM Dispatcher filter configuration, each numbered rule combines /type, /extension, and /path conditions that are evaluated together, and the /path value must be a regular expression that matches the actual URL paths you intend to restrict. To deny JSON and HTML requests under two distinct context roots, the /path expression has to alternate between both root paths, e.g. a pattern equivalent to (/path1|/path2)(/.*)?, so that the rule applies uniformly to everything under /path1 and everything under /path2. A rule whose second alternative names an extension (such as HTML) instead of the second context root fails to restrict /path2 at all and instead produces a nonsensical path match, meaning it would not fulfill the requirement. The configuration that lists both /path1 and /path2 in its path condition is the one that correctly denies JSON and HTML requests under both context paths.
Community Discussion