首页 > 解决方案 > 在 IIS web.config 中,我如何重定向 URL 并使子域成为子文件夹和子文件夹成为查询字符串

问题描述

在 azure app 服务中使用 web.config,如果我使用它

  <rules>
    <rule name="CName to URL" stopProcessing="true">
      <match url=".*" />
      <conditions>
        <add input="{HTTP_HOST}" pattern="^(?!www)(.*)\.example\.com$" />
      </conditions>
      <action type="Redirect" url="http://example.com/{C:1}" />
    </rule>
  </rules>

我可以将它从 d0036.example.com 更改为 example.com/d0036

但是,我似乎无法从 d0036.example.com/path1/path2 到 example.com/d0036?p1=path1&p2=path2

标签: redirectweb-configsubdomainquery-string

解决方案


推荐阅读