【问题标题】:config redirect to match specific pattern配置重定向以匹配特定模式
【发布时间】:2016-08-30 13:09:38
【问题描述】:

如何在 web.config 中调整自动重定向:

<rule name="Redirect_to_https" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" ignoreCase="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{R:1}" redirectType="Permanent" appendQueryString="true" />
</rule>

以例如应用规则的方式

site1.internal.sw-company.com
site2.internal.sw-company.com
site3.internal.sw-company.com

到所有 3 个站点和子页面,但不到以下地址:service1.internal.sw-company.com(驻留在同一服务器上的服务)

我正在使用 C# 和 ASP.NET 4.5

【问题讨论】:

    标签: c# redirect web-config


    【解决方案1】:
    site\d+.internal.sw-company.com
    

    也许这种模式对你有用?

    【讨论】:

      猜你喜欢
      • 2016-11-18
      • 1970-01-01
      • 2023-01-10
      • 1970-01-01
      • 1970-01-01
      • 2017-01-23
      • 2013-01-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多