我有 2 个网址 http://test.mysite.com(1)和 http://test.mysite.com/app (2)
我想将请求重定向到 (1) 到 www.othersite.com当 (2) 不应重定向时。
是否可以使用正则表达式重写网址?
BR
是的,可以使用 URL 重写模块。您的规则如下所示:
<rule name="Redirect non app" stopProcessing="true">
<match url="^app(.*)" negate="true" />
<action type="Redirect" url="http://www.othersite.com{REQUEST_URI}" />
</rule>