Skip to content

Instantly share code, notes, and snippets.

@wushan
Last active September 4, 2019 06:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wushan/73be5b3fcef1e148219812a9031e2336 to your computer and use it in GitHub Desktop.
Save wushan/73be5b3fcef1e148219812a9031e2336 to your computer and use it in GitHub Desktop.
Rewrite Ruls for Vue.js SPA on IIS
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="backend" stopProcessing="true">
<match url="^(backend)(.*)$" />
<action type="None" />
</rule>
<rule name="Vuejs rules" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@qianthinkover
Copy link

could you tell me how to use it ?
when I code in my web.config file, the errors have happened.
My problem is that my vue spa page deployment on iis, I cannot refresh,if did it ,404 will happend

@Qblack
Copy link

Qblack commented Oct 22, 2017

A little late but I needed to do this today so am logging it here for the future.
Create a web.config file in the folder of app and paste it in.
You may need to add if there is not an existing file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment