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:

  1. Review existing redirect rules:

    • Check your Edge Delivery Services redirect configuration (such as redirects spreadsheet or redirects.json) for any rules affecting / or /en.
  2. Inspect CDN configuration:

    • Examine your cdn.yaml file for any custom handling of the root path (/) or /en.
  3. Remove conflicting rules:

    • Ensure that only a single redirect is configured for / to /en, and that /en doesn’t trigger further redirects.
  4. Implement the redirect at the appropriate layer:

    • Prefer implementing the 301 redirect from / to /en at the CDN level (using cdn.yaml) to avoid conflicts with Edge Delivery Services internal routing.

    • Example cdn.yaml rule:

    • source: /

    • target: /en

    • status: 301

  5. Validate routing behavior:

    • Confirm that Edge Delivery Services routing doesn’t internally resolve / to /en before applying the redirect rule, as this can cause a redirect loop.
  6. Test redirect behavior:

    • After applying the configuration, test the following:

    • Request to / returns a 301 redirect to /en.

    • Request to /en returns a 200 OK and serves the homepage.

    • Other URLs are unaffected.

  7. Monitor for redirect loops:

    • Use browser developer tools or command-line tools to verify that no redirect loops occur.
recommendation-more-help
experience-cloud-kcs-help-kbarticles