0
我有一个目录,看起来像这样:如何将所有请求重定向到IIS服务器上的根目录?
/root
/home
/about
index.html
我example.com的域名指向到我的根目录下,我想配置像example.com/home或example.com/about所有请求留在根目录并返回index.html。
我有一个目录,看起来像这样:如何将所有请求重定向到IIS服务器上的根目录?
/root
/home
/about
index.html
我example.com的域名指向到我的根目录下,我想配置像example.com/home或example.com/about所有请求留在根目录并返回index.html。
此规则将将所有(包括css,js和其他资源)非主页请求重写到您的index.html根目录上。
<rule name="rewrite to index" enabled="true" stopProcessing="true">
<match url="^$" negate="true" />
<action type="Rewrite" url="/index.html" />
</rule>