Redirect user to a friendly message page for 406 Error - Not Acceptable | Community
Skip to main content
Level 1
June 27, 2026
Question

Redirect user to a friendly message page for 406 Error - Not Acceptable

  • June 27, 2026
  • 1 reply
  • 0 views

The new CDN rules are blocking anything that ends with .php, contains /wp-content, or contains /wp-config.
We want to extend the ACS-Commons Error Handling currently being used for 404. 

404 and 500 friendly pages are being redirected but the 406 is not working. 

    1 reply

    Level 4
    June 27, 2026

    Hi ​@SwethaBe2,

     

    The 406 is being blocked at the CDN layer before it even reaches AEM, so ACS Commons error handling won’t intercept it, that only covers errors that make it through to the Sling/dispatcher layer.

     

    To serve a friendly page for CDN-blocked requests, you need to handle it in your CDN rules config directly. In AEM Cloud Service you can define an errorPages section in your CDN rules YAML to redirect specific status codes to a static or cached friendly page.

     

    Something like:

    kind: CDN
    version: '1'
    metadata:
      envTypes: [dev, stage, prod]
    data:
      errorPages:
        rules:
          - name: handle-406
            when:
              reqStatus: 406
            action:
              type: redirect
              location: /errors/not-acceptable

     

    The target page should be published and publicly accessible. This keeps the friendly UX consistent regardless of where in the stack the error originates.