Skip to content

trojanh/nextjs-react-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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";

About

Demonstrates and fix Netlify routing issue

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published