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
.htmlis 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:
-
Review the Dispatcher rewrite rules for the affected vhost.
-
Determine whether a rule exists that appends
.htmlto extension-less requests under the affected content path. -
If the rule is missing, add a rewrite rule similar to the following to the Dispatcher rewrite rules file:
RewriteCond %{REQUEST_URI} /content/your-pathRewriteCond %{REQUEST_URI} !.[ a-zA-Z0-9] +/?$RewriteCond %{REQUEST_URI} !.xfttl.html/?$RewriteRule (.+)/?$ ${lc:$1.html} [ PT,L]
-
Adjust
/content/your-pathas required for the specific content structure. -
Test the change in a lower environment before deploying it to Production.
-
After deployment, flush the Dispatcher cache and purge the CDN cache for the affected content path.
-
Verify that extension-less URLs under the affected content path return the expected page content with an HTTP 200 response.