Answers for "Site cannot be accessed broken link or url that doesn’t exist react netlify"

2

Site cannot be accessed broken link or url that doesn’t exist react netlify

If you see "Not Found" error while directly browsing to a specific path, For eg: https://yourdomain.com/something , this might be helpfull (ReactJS):

In your public folder (folder which contains index.html) create a file called _redirects with no extension. Then, type the following inside it:

/*    /index.html    200

Now save, commit, push and publish. :)

Reason for "Not Found" is because, when using router eg: React Router it handles all the routes but when you directly goto an endpoint, netlify must know where to redirect you. That is what we are specifying in the _redirects file.
Posted by: Guest on October-30-2020

Code answers related to "Site cannot be accessed broken link or url that doesn’t exist react netlify"

Code answers related to "Javascript"

Browse Popular Code Answers by Language