Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Updates to History Mode for Apache w/ subfolder #3066

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Expand All @@ -34,6 +34,8 @@ Not to worry: To fix the issue, all you need to do is add a simple catch-all fal
</IfModule>
```

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
Expand Down