diff --git a/docs/guide/essentials/history-mode.md b/docs/guide/essentials/history-mode.md index 5eeaad033..d2dbbe0b2 100644 --- a/docs/guide/essentials/history-mode.md +++ b/docs/guide/essentials/history-mode.md @@ -19,11 +19,11 @@ Not to worry: To fix the issue, all you need to do is add a simple catch-all fal ## Example Server Configurations -**Note**: The following examples assume you are serving your app from the root folder. If you deploy to a subfolder, you should use [the `publicPath` option of Vue CLI](https://cli.vuejs.org/config/#publicpath) and the related [`base` property of the router](https://router.vuejs.org/api/#base). You also need to adjust the examples below to use the subfolder instead of the root folder (e.g. replacing `RewriteBase /` with `RewriteBase /name-of-your-subfolder/`). +**Note**: The following examples assume you are serving your app from the root folder. If you deploy to a subfolder, you should use [the `publicPath` option of Vue CLI](https://cli.vuejs.org/config/#publicpath) and the related [`base` property of the router](https://router.vuejs.org/api/#base). You also need to adjust the examples below to use the subfolder instead of the root folder (e.g. replacing `RewriteBase /` with `RewriteBase /name-of-your-subfolder`. #### Apache -```apache +```apacheconf RewriteEngine On RewriteBase / @@ -34,6 +34,8 @@ Not to worry: To fix the issue, all you need to do is add a simple catch-all fal ``` +If using subfolders, you'll need to adjust `RewriteBase` as per above along with `RewriteRule ^index\.html$ -[L]` to `RewriteRule ^name-of-your-subfolder/index\.html$ -[L]` and `RewriteRule . /index.html [L]` to `RewriteRule . /name-of-your-subfolder/index.html [L]`). + Instead of `mod_rewrite`, you could also use [`FallbackResource`](https://httpd.apache.org/docs/2.2/mod/mod_dir.html#fallbackresource). #### nginx