Netlify Redirects

Single Page Application Routing

If you enter a specific URL route for your SPA, by default Netlify won’t know what to do with it and your page won’t load.

To fix ths you will need to add a _redirects file to your source directory.

1
2
src
- _redirects

Update your angular.json file so that it gets picked up as an asset.

1
2
3
4
5
6
7
...
"assets": [
"src/favicon.ico",
"src/assets",
"src/_redirects"
],
...

For your SPA you will need to redirect everything back to index.html.
Add the following to the _redirects file.

1
/* /index.html 200

Deploy your app and refresh your page…done.