如何将特定文件夹重写为根域,例如 domain.org/folderxxxx =>的 domain.org 即可。如果我看到 domain.org ,实际上它会显示 domain.org/folderxxxx 。我试过以下:
<rewrite>
<rules>
<rule name="URL Alias" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="domain.org/folderxxxx" />
</conditions>
<action type="Rewrite" url="domain.org{R:0}" />
</rule>
</rules>
</rewrite>
但它不再起作用了。
答案 0 :(得分:0)
domain.org
中打开,则会打开此网址domain.org/folderxxxx
domain.org/xyz
- &gt; domain.org/folderxxxx/xyz
domain.org/folderxxxx
它将禁用重写将打开来自同一domain.org/folderxxxx
web.config中的规则:
<rule name="URL Alias" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_URI}" pattern="^/folderxxxx" negate="true" />
</conditions>
<action type="Rewrite" url="/folderxxxx/{R:0}" />
</rule>