CDN domain redirect and routing issues in AEM Cloud and AMS environments
Adobe Experience Manager (AEM) encounters domain redirect and routing issues when domains do not map correctly or redirects fail due to unsupported configurations or missing prerequisites. This occurs because redirect behavior depends on execution layer such as CDN, Dispatcher, or AEM, and due to limitations like lack of wildcard domain support and required SSL configuration. To resolve the issue, identify the correct redirect mechanism and configure domain registration, SSL, and redirect rules based on the AEM runtime.
Description description
Environment
- Adobe Experience Manager as a Cloud Service (AEMaaCS)
- Adobe Managed Services (AMS)
- Adobe Experience Manager (AEM) On-Premise
Issue/Symptoms
- The domain always resolves to the site root instead of the intended page.
- Redirects result in infinite loops due to incorrect host header behavior.
- Redirects do not trigger because the domain is not registered in Cloud Manager.
- Wildcard subdomains (
*.example.com) cannot be added and traffic fails. - CDN pipeline deployment fails due to invalid configuration syntax.
Root cause
Redirect behavior depends on where the redirect executes, such as CDN, Dispatcher, or AEM. AEM as a Cloud Service requires explicit domain registration and valid SSL certificates for CDN processing. Wildcard domain mappings are not supported, and incorrect configuration of redirect rules or host headers causes failures or loops.
Resolution resolution
Follow these steps to configure correct domain-based redirects and routing behavior:
- Identify whether the redirect must occur before AEM processes the request or after it reaches AEM to determine the correct execution layer.
- Use CDN redirects for domain-to-path routing in AEM as a Cloud Service.
- Use Dispatcher or Apache rewrite rules for Adobe Managed Services or on-premise environments.
- Use an external redirect service if the requirement involves dynamic wildcard subdomains that AEM does not support.
- Use CDN-based redirects for host-level routing when using Edge Delivery Services because only exact path matches are supported at the application layer.
For AEM as a Cloud Service (AEMaaCS)
- Open Cloud Manager, navigate to Environments, and access Domain Management to add all domains required for redirect.
- Upload and configure valid SSL certificates for each domain, including non-www domains.
- Verify that each domain shows an active status with a valid certificate.
- Create or update the
cdn.yamlfile in the repository root to define redirect rules. - Define redirect rules using host-based conditions with the required status code and destination path or URL.
- Run the Cloud Manager configuration pipeline to deploy CDN rules and validate that deployment completes successfully.
- Fix any syntax errors in the configuration file by reviewing pipeline logs and correcting rule structure.
- Configure pattern-based redirects using supported match conditions where applicable.
- Avoid using wildcard hostnames in CDN rules because they are not supported.
For Adobe Managed Services (AMS) or On-Premise
- Add rewrite rules in Dispatcher or Apache configuration files to implement domain-level redirects.
- Configure virtual host entries for each domain or subdomain to enable proper routing.
- Map each domain or subdomain to the appropriate AEM site root.
- Validate that virtual host configuration allows correct domain resolution and prioritization.
For Edge Delivery Services (EDS)
Configure redirects only for exact path matches at the application level and handle host-based redirects at the CDN layer.
Validation:
- Run HTTP requests using tools such as curl and verify that the response contains the correct redirect status and location header.
- Check CDN logs or deployment results to confirm that redirect rules execute correctly.
- Verify that no redirect loops occur by ensuring consistent host and forwarded host behavior across requests.
When to escalate:
- The redirect behavior does not match expected logic after implementing the correct redirect mechanism.
- CDN configuration deployment fails due to unresolved validation or syntax errors.
- Domains fail to route despite proper registration and valid SSL certificates.
- Redirect loops persist due to host header inconsistencies.
- Wildcard or dynamic domain routing requirements cannot be implemented using supported AEM capabilities.