Pierce
Pierce

Reputation: 53

Problems setting up 404 page on Gatsby site in AWS Amplify

I have a simple Gatsby site that I've deployed through AWS Amplify based on this guide. However, I'm struggling to set up a proper 404 page through the AWS Amplify Console (or via a config file).

I want it to behave like a standard 404 page such as that on Google.com – i.e.

What's happening currently:

Can anyone help with this? I'm not really clear if there are more advanced configuration options I'm missing outside the console? Can I do something with the build settings using the amplify.yml file?

Thanks

Upvotes: 5

Views: 1601

Answers (1)

Jamie
Jamie

Reputation: 477

This can now be achieved on AWS Amplify by setting up the following rewrite in Rewrites and redirects:

  • Source address: /<*>
  • Target address: /404.html
  • Type: 404 (Rewrite)

Upvotes: 7

Related Questions