Table of contents
No headings in the article.
Today we will learn how to overcome netlify redirect issue for React web app
If you are using netlify I'm sure you face the above issue but when I'm here nothing to fear. Let's solve the issue of netlify redirect.
Now, what the issue is?? So the issue is whenever we try to access any internal route of our application directly it throws a 404-page error. Let's solve the issue.
Open your code editor.
Now go to the public folder and create a new file "__redirects".
/* /index.html 200
Paste the above code in your "__redirects" file.
Now this redirect rule which was just added to the public folder will always serve the index.html file not a 404 page.
Now commit your changes and build your project for production.
Now revisit the link.
Thanks a lot for reading till the end ๐ You can contact me in case if you need any assistance:
Email: atul19251@gmail.com
Web: https://iamatul.netlify.app/
GitHub: https://github.com/iamrajput
LinkedIn:https://www.linkedin.com/in/atul-kumar-singh-673357102/