Preventing redirect loops when redirecting root path to /en in Adobe Experience Manager Edge Delivery Services
This article explains how to resolve redirect loop issues that occur when configuring Adobe Experience Manager Edge Delivery Services to redirect the root path (/) to /en for homepage SEO purposes.
Description description
Environment
Adobe Experience Manager Edge Delivery Services (all versions)
Symptoms
When configuring a 301 redirect from the root path (/) to /en, requests to the root URL result in a redirect loop instead of a single redirect to /en. This causes both the root and /en URLs to be crawled as separate pages by search engines, leading to duplicate homepage SEO concerns.
Cause
A redirect loop occurs if both the Edge Delivery Services routing and the redirect configuration attempt to resolve the root path (/) to /en, causing the redirect condition to be repeatedly evaluated. Conflicting or duplicate redirect rules at different layers (such as Edge Delivery Services and CDN) also contribute to this behavior.
Resolution resolution
Follow the steps below to resolve the issue:
-
Review existing redirect rules:
- Check your Edge Delivery Services redirect configuration (such as redirects spreadsheet or
redirects.json) for any rules affecting/or/en.
- Check your Edge Delivery Services redirect configuration (such as redirects spreadsheet or
-
Inspect CDN configuration:
- Examine your
cdn.yamlfile for any custom handling of the root path (/) or/en.
- Examine your
-
Remove conflicting rules:
- Ensure that only a single redirect is configured for
/to/en, and that/endoesn’t trigger further redirects.
- Ensure that only a single redirect is configured for
-
Implement the redirect at the appropriate layer:
-
Prefer implementing the 301 redirect from
/to/enat the CDN level (usingcdn.yaml) to avoid conflicts with Edge Delivery Services internal routing. -
Example
cdn.yamlrule: -
source:
/ -
target:
/en -
status: 301
-
-
Validate routing behavior:
- Confirm that Edge Delivery Services routing doesn’t internally resolve
/to/enbefore applying the redirect rule, as this can cause a redirect loop.
- Confirm that Edge Delivery Services routing doesn’t internally resolve
-
Test redirect behavior:
-
After applying the configuration, test the following:
-
Request to
/returns a 301 redirect to/en. -
Request to
/enreturns a 200 OK and serves the homepage. -
Other URLs are unaffected.
-
-
Monitor for redirect loops:
- Use browser developer tools or command-line tools to verify that no redirect loops occur.