'Add URL rewriting to React NPM project
I currently have a static website running on an nginx server. I am moving this over to React and so need to get my website working as an NPM project.
Currently all the html pages work without having the .html file extension in the URL. For example www.xyz.com/login is equivalent to www.xyz.com/login.html (but looks cleaner in the browser).
How do I get this to behave in the same way on an NPM based web project?
Working perfectly on nginx using the following line in nginx.conf file:
location / { try_files $uri $uri/ /$uri.html /index.html; }
What is the npm equivalent?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
