Mar*_*ios 2 iis redirect web-config
我有一个子目录 ( http://example.com/forum
) 我想 301 重定向到一个新的子域htttp://forum.exampple.com
. 如何使用 Web.config 和 IIS 重写设置重定向以将所有请求发送http://example.com/forum/*
到htttp://forum.exampple.com
?谢谢!
通过转换 ssri 提供的规则,该规则在 web.config 文件中应如下所示:
<rewrite>
<rules>
<rule name="your name here" stopProcessing="true">
<match url="^forum/(.*)$" ignoreCase="false" />
<action type="Redirect" redirectType="Permanent" url="http://forum.exampple.com/{R:1}" />
</rule>
</rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)
将它放在 system.webServer 标签之间。
归档时间: |
|
查看次数: |
12504 次 |
最近记录: |