[英]Is there way to redirect URL from one domain to new domain using IIS URL rewrite module?
[英]IIS using (URL Rewrite) to Redirect to another domain
trying to redirect from https://www.domain.info/cms-cp/login.html
to https://www-server2.domain.info/cms-cp/login.html
by using the following code for (URL Rewrite ) 插件,但不幸的是无法正常工作。
<rule name="Redirect To Web2 Server CMS" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^(www.domain.info/cms-cp/login.html)$" />
</conditions>
<action type="Redirect" url="https://www-server2.domain.info/cms-cp/login.html" redirectType="Permanent" />
</rule>
<rule name="Redirect To Server2" patternSyntax="ECMAScript" enabled="true" stopProcessing="true">
<match url="login.html" />
<conditions trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^www\.domain\.info$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://www-server2.domain.info/cms-cp/login.html" redirectType="Permanent" />
</rule>
{HTTPS} 只是一个布尔值,用于检查 https 是否已启用。 所以你可以像这样应用规则
<rule name="Redirect To Web2 Server CMS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^on$" />
<add input="{HTTP_HOST}" pattern="www\.domain\.info" />
<add input="{URL}" pattern="^/cms-cp/login.html$" />
</conditions>
<action type="Redirect" url="https://www-server2.domain.info/cms-cp/login.html" />
</rule>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.