Skip to content

Commit 7646663

Browse files
AngeloAnolinyyx990803
authored andcommitted
Add configuration settings for IIS (Windows) (#1240)
* Add configuration settings for IIS (Windows) * Update history-mode.md
1 parent 0aea9c5 commit 7646663

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/en/essentials/history-mode.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,34 @@ location / {
4444

4545
For Node.js/Express, consider using [connect-history-api-fallback middleware](https://github.com/bripkens/connect-history-api-fallback).
4646

47+
#### Internet Information Services (IIS)
48+
```
49+
<?xml version="1.0" encoding="UTF-8"?>
50+
<configuration>
51+
<system.webServer>
52+
<rewrite>
53+
<rules>
54+
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
55+
<match url="(.*)" />
56+
<conditions logicalGrouping="MatchAll">
57+
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
58+
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
59+
</conditions>
60+
<action type="Rewrite" url="index.html" />
61+
</rule>
62+
</rules>
63+
</rewrite>
64+
<httpErrors>
65+
<remove statusCode="404" subStatusCode="-1" />
66+
<remove statusCode="500" subStatusCode="-1" />
67+
<error statusCode="404" path="/survey/notfound" responseMode="ExecuteURL" />
68+
<error statusCode="500" path="/survey/error" responseMode="ExecuteURL" />
69+
</httpErrors>
70+
<modules runAllManagedModulesForAllRequests="true"/>
71+
</system.webServer>
72+
</configuration>
73+
```
74+
4775
## Caveat
4876

4977
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:

0 commit comments

Comments
 (0)