Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Jan 12, 2017

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

This comment has been minimized.

Copy link

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
You can’t perform that action at this time.