Static-web-apps: Request for custom HTTP 404 page

Created on 25 May 2020  路  3Comments  路  Source: Azure/static-web-apps

I'd like to see an option to have a custom HTTP 404 page. Super simple implementation would be to publish a page to /404.html (how Hugo does it by default)

Most helpful comment

Hi @wictorwilen,

This exists today: https://docs.microsoft.com/en-us/azure/static-web-apps/routes#custom-error-pages

Take a look at the example routes.json file as it shows a custom 404

All 3 comments

Hi @wictorwilen,

This exists today: https://docs.microsoft.com/en-us/azure/static-web-apps/routes#custom-error-pages

Take a look at the example routes.json file as it shows a custom 404

Thanks!

FYI, you need to use

    "responseOverrides": {
        "404": {
          "rewrite": "/404.html"
        }
    }

as defined at https://docs.microsoft.com/en-us/azure/static-web-apps/configuration#response-overrides.

For some reason

  "platformErrorOverrides": [
    {
      "errorType": "NotFound",
      "serve": "/404.html"
    }
  ]

doesn't work for me.

Was this page helpful?
0 / 5 - 0 ratings