Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (20 sloc) 722 Bytes

Detailed Blog https://blog.kiprosh.com/show-custom-404-error-page-for-netlify-applications/

Preview Available on Netlify

This Repo demonstrates issue with Netlify routing and a simple hack to fix it.

for redirects

[[redirects]]
  from = "/*"
  to = "/error"
  status = 404

Netlify should redirect user to /error for any route which is not found but for routes starting with /error (starting with to path) i.e

/error__
/error*

Netlify still shows its default 404 error page. We can fix this issue by creating 404.html and adding following code to redirect user to error page

    window.location.href = window.location.origin + "/error";
You can’t perform that action at this time.