我的IIS服务器有一个带有A记录的子域:
sub.domain.com
IIS服务器具有用于sub.domain.com的绑定和用于*.domain.com的证书
我们需要的是,当有人去sub.domain.com时,它会把他们带到另一个网站,但会屏蔽网址并保留SSL。目标页在其SAN证书sub.domain.com中。
我在Godaddy上尝试了一个转发,但它没有保留SSL,我们得到了证书问题。所以我的想法是指向我们的服务器来传递SSL,然后重定向它。我尝试了URL重写,但它给出了404。
URL重写:
<rewrite>
<rules>
<clear />
<rule name="Pay Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="^(www\.)?sub\.domain\.com$" />
</conditions>
<action type="Redirect" url="https://www.domain2.com/cgsdesktop/PaymentLanding/UniversalPortal" appendQueryString="false" />
</rule>
</rules>
</rewrite>我只想知道怎么搞定这件事。
发布于 2020-06-24 21:34:23
这样如何:
<rules>
<rule name="Pay Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^sub.domain.com$" ignoreCase="true"/>
<add input="{HTTP_HOST}" pattern="^www.sub.domain.com$" ignoreCase="true"/>
</conditions>
<action type="Redirect" url="https://www.domain2.com/cgsdesktop/PaymentLanding/UniversalPortal" appendQueryString="false" />
</rule>
</rules>使用sub.domain.com而不是sub\.domain\.com。
This article包含一些关于IIS重定向/重写规则的有用配方。
发布于 2020-06-25 11:18:15
为了屏蔽URL并将SSL保留在浏览器栏中,我们需要创建URL重写扩展的URL重写操作规则。

但是,默认情况下,URL重写操作仅支持将请求重定向到相同的域名。当将请求重定向到另一个网站时,我们必须安装应用程序请求路由扩展。
https://www.iis.net/downloads/microsoft/application-request-routing
否则我们将得到一个Http 404错误。
有关详细信息,请参阅我之前的帖子。
ASP.net URL Rewrite subdirectory to external URL
如果有什么我能帮上忙的,请随时告诉我。
https://stackoverflow.com/questions/62554726
复制相似问题