Extension-less page URLs return 404 in AEM as a Cloud Service

Adobe Experience Manager as a Cloud Service (AEMaaCS) may return HTTP 404 for extension-less page URLs when the affected vhost doesn’t have a Dispatcher rewrite rule that appends .html. To resolve the issue, add the required rewrite rule for the affected content path, test it in a lower environment, deploy it, and clear the relevant caches.

Description description

Environment

Adobe Experience Manager as a Cloud Service (AEMaaCS)

Issue/Symptoms

  • Extension-less URLs under specific content paths return HTTP 404 on the Publisher instance.
  • The same pages are accessible through the Production domain or when.html is appended to the URL.
  • Pages under other content paths work without a file extension.

Root cause

The Dispatcher configuration for the affected vhost allows requests to /content/* paths only when they include a recognized file extension, such as .html. Some content paths have rewrite rules that append .html to extension-less requests, while the affected paths don’t, causing those requests to return HTTP 404.

Resolution resolution

Follow the steps below to resolve the issue:

  1. Review the Dispatcher rewrite rules for the affected vhost.

  2. Determine whether a rule exists that appends .html to extension-less requests under the affected content path.

  3. If the rule is missing, add a rewrite rule similar to the following to the Dispatcher rewrite rules file:

    • RewriteCond %{REQUEST_URI} /content/your-path
    • RewriteCond %{REQUEST_URI} !.[ a-zA-Z0-9] +/?$
    • RewriteCond %{REQUEST_URI} !.xfttl.html/?$
    • RewriteRule (.+)/?$ ${lc:$1.html} [ PT,L]
  4. Adjust /content/your-path as required for the specific content structure.

  5. Test the change in a lower environment before deploying it to Production.

  6. After deployment, flush the Dispatcher cache and purge the CDN cache for the affected content path.

  7. Verify that extension-less URLs under the affected content path return the expected page content with an HTTP 200 response.

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