Extensionless URLs redirect to an internal domain in AEM as a Cloud Service

This article explains why extension-less URLs on AEM Publish redirect to the internal domain instead of the configured custom domain, and provides guidance on how to address this behavior.

Description description

Environment

  • Adobe Experience Manager as a Cloud Service
  • Publish environment
  • Dispatcher with URL rewrite rules
  • Custom domain

Issue/Symptoms

  • A custom-domain URL with a supported extension, such as .html, resolves correctly and remains on the custom domain.
  • Accessing the same URL without the extension, such as /en/example-page instead of /en/example-page.html, redirects to the same path on the internal domain.
  • The behavior occurs in the AEM Publish environment with Dispatcher and URL rewrite rules configured.

Cause

The Dispatcher rewrite rules apply only to requests with recognized extensions, such as .html, .jpg, .png, and .svg. An extensionless request bypasses these rules and is handled by AEM’s internal vanity or friendly URL resolution. AEM then redirects the request to the fully qualified content path by using the internal domain instead of the custom domain, which causes the hostname mismatch.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the Dispatcher rewrite configuration and verify that the friendly URL rules apply only to requests with recognized extensions, such as .html, .jpg, .png, and .svg. For example:

    code language-none
    RewriteCond %{REQUEST_URI} (.html|.jpe?g|.png|.svg)$
    RewriteRule /(.*)$ /content/${CONTENT_FOLDER_NAME}/$1 [ PT,L]
    
  2. Verify that extensionless requests bypass the Dispatcher rewrite rules and are handled by AEM’s internal URL resolution, which redirects the requests by using the internal domain.

  3. Review and adjust the AEM configuration used to construct redirect URLs. Verify that AEM uses the original host header or custom domain when it redirects extensionless URLs.

  4. If you can’t customize the redirect hostname through Dispatcher or AEM configuration, review the Adobe documentation or contact Adobe Support for guidance on customizing redirect hostnames in AEM as a Cloud Service.

  5. If the issue persists, collect a HAR file or network trace for further diagnosis.

  6. After updating the configuration, access the extensionless URLs and verify that they redirect to the correct custom domain.

recommendation-more-help
experience-cloud-kcs-help-kbarticles