From: Carter Snook Date: Mon, 5 Oct 2020 12:20:49 +0000 (-0500) Subject: docs: add netlify section for history mode rewrites (#510) [skip ci] X-Git-Tag: v4.0.0-rc.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86f74e42a5222e1b83f604a12c786c2d1ad6f0e3;p=thirdparty%2Fvuejs%2Frouter.git docs: add netlify section for history mode rewrites (#510) [skip ci] --- diff --git a/docs/guide/essentials/history-mode.md b/docs/guide/essentials/history-mode.md index 6411f564..ecc941dc 100644 --- a/docs/guide/essentials/history-mode.md +++ b/docs/guide/essentials/history-mode.md @@ -149,6 +149,16 @@ Add this to your `firebase.json`: } ``` +### Netlify + +Create a `_redirects` file with the following code: + +``` +/* /index.html 200 +``` + +Read more about [Netlify redirecting options](https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps) for more info. + ## Caveat There is a caveat to this: Your server will no longer report 404 errors as all not-found paths now serve up your `index.html` file. To get around the issue, you should implement a catch-all route within your Vue app to show a 404 page: