.htaccess file for React Router
· One min read
If you’re using react-router as part of your React project, you’ll need to add a .htaccess file in order for it to work on the server.
This snippet will forward all URLs to index.html
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]