URL redirection is a common aspect as part of website operation. Architects and administrators are challenged to find the best solution on how and where to manage the URL redirects that provide flexibility and fast redirect deployment time.
The other AEM services (AEM Author/Publish, and Dispatcher) are otherwise conceptually similar between AEM 6.x and AEM as a Cloud Service.
AEM’s URL redirect solutions are as follows:
|Managed & deployed as AEM project code
|Ability to change by marketing/content team
|AEM as Cloud Service compatible
|Where redirection execution happens
|At Edge via bring your own CDN
mod_rewrite rules as Dispatcher config
|ACS Commons - Redirect Map Manager
|ACS Commons - Redirect Manager
Redirect page property
The following are solution options in the order of being closer to the website visitor’s browser.
Some CDN services provide redirection solutions at the Edge level thus reducing round trips to the origin. See Akamai Edge Redirector, AWS CloudFront Functions. Please consult with your CDN service provider for Edge level redirection capability.
Managing redirects at Edge or CDN level has performance advantages, however they are not managed as part of AEM but rather discrete projects. A well-thought process to manage and deploy redirect rules is crucial to avoid problems.
A common solution uses Apache Module mod_rewrite. The AEM Project Archetype provides a Dispatcher project structure for both AEM 6.x and AEM as a Cloud Service project. The default (immutable) and custom rewrite rules are defined in the
conf.d/rewrites folder and the rewrite engine is turned ON for
virtualhosts that listens on port
conf.d/dispatcher_vhost.conf file. An example implementation is available in the AEM WKND Sites Project.
In AEM as a Cloud Service, these redirect rules are managed as part of AEM code and deployed via Cloud Manager Web Tier config pipeline or Full-stack pipeline. Thus your AEM project-specific process is at play to manage, deploy, and trace the redirect rules.
Most CDN services do cache the HTTP 301 and 302 redirects depending on their
Expires headers. This helps to avoid the round trip after the initial redirect originating at Apache/Dispatcher.
There are two features available within ACS AEM Commons to manage URL redirects. Please note, ACS AEM Commons is a community-operated, open-source project and not supported by Adobe.
Redirect Map Manager allows AEM 6.x administrators to easily maintain and publish Apache RewriteMap files without directly accessing Apache Web server or requiring an Apache web server restart. This feature allows permissions users to create, update, and delete redirect rules from a console in AEM, without the help of the development team or an AEM deployment. Redirect Map Manager is NOT AEM as a Cloud Service compatible.
Redirect Manager allows the users in AEM to easily maintain and publish redirects from AEM. The implementation is based on Java™ servlet filter, thus typical JVM resource consumption. This feature also eliminates the dependency on the AEM development team and the AEM deployments. Redirect Manager is both AEM as a Cloud Service and AEM 6.x compatible. While the initial redirected request must hit AEM Publish service to generate the 301/302 (most) CDNs’ cache 301/302 by default, allowing subsequent requests to be redirected at the edge/CDN.
Redirect page property
The out-of-the-box (OOTB)
Redirect page property from the Advanced tab allows content authors to define the redirect location for the current page. This solution is best for per-page redirect scenarios and does not have a central location to view and manage the page redirects.
Below are a few criteria to determine the right solution. Also, your organization’s IT and Marketing process should help to pick the right solution.