AEMaaCS CDN – Custom 404 handling (EN + FR) | Community
Skip to main content
Level 1
May 4, 2026
Question

AEMaaCS CDN – Custom 404 handling (EN + FR)

  • May 4, 2026
  • 2 replies
  • 69 views

Hi all,
We’re using AEM as a Cloud Service CDN configuration where requests are routed to Azure Blob Storage using a one-to-one mapping between CDN YAML path patterns and blob container folder structure.

kind: "CDN"
version: "1"
data:
originSelectors:
rules:
- name: "page-origin"
when:
reqProperty: "path"
matches: "^/(page)(/.*)?$"
action:
selectOrigin: "blob-storage-origin"

Problem: When a path maps to blob storage but the file does not exist (origin returns 404), we want to display a custom 404 experience and it must support both locales:
English 404 for non-/fr paths
French 404 for /fr/* paths
Question: Is there any supported way in AEMaaCS CDN YAML to:
map/override origin 404 to a custom page/route (rewrite or redirect), and
do this per locale (EN vs FR)?
We looked at errorPages but schema validation indicates only errorPages.spa is supported (no custom “rules” / mapping).
If CDN config cannot do this, what is the recommended approach in AEMaaCS for this use case (Dispatcher error document, AEM Sling error handler, app-level logic, etc.)?
Thanks!
 

    2 replies

    Adobe Employee
    May 5, 2026

    Hello ​@SiddhiDa2 

    At this time, AEM as a Cloud Service CDN configuration does not support mapping an origin-returned 404 to a custom localized page body. The CDN errorPages capability is intended for cases where the Adobe-managed CDN cannot reach the origin, and the supported schema today is the SPA-based configuration documented by Adobe rather than rule-based per-status/per-locale mappings.
    Sources:

    For your use case, the recommended pattern is to implement the custom 404 handling behind the CDN, using either:

    • an AEM Sling error handler for a true branded 404 response with locale-aware rendering, or
    • Dispatcher ErrorDocument handling if a simpler/static error page model is preferred.

    This approach allows you to preserve the correct HTTP 404 status while serving different experiences for:

    • French requests under /fr/*
    • English requests for non-/fr/* paths

    Adobe's AEMaaCS guidance for custom error pages points to customizing AEM-served or Dispatcher-served error responses rather than using CDN YAML for origin 404 remapping.

    chaudharynick
    Level 4
    May 5, 2026

    No. As you correctly identified, the AEMaaCS CDN YAML does not currently support error page handling for the website, but it does handle the global outage error page.

     

    You have to use the Dispatcher ErrorDocument configuration to handle it.

     

    example:

    # ---------------------------------------------------------
    # Default Fallback Error Page (English)
    # ---------------------------------------------------------
    ErrorDocument 404 /content/mysite/us/en/errors/404.html
    ErrorDocument 500 /content/mysite/us/en/errors/500.html

    # ---------------------------------------------------------
    # Localized Error Pages (French)
    # ---------------------------------------------------------
    <LocationMatch "^/fr/.*">
    ErrorDocument 404 /content/mysite/fr/errors/404.html
    ErrorDocument 500 /content/mysite/fr/errors/500.html
    </LocationMatch>