【问题标题】:Azure WebApp Subdomain RewriteAzure WebApp 子域重写
【发布时间】:2017-04-11 18:59:39
【问题描述】:

我有一个简单的重写 URL,它获取我们的子域并将其重写为我们主网站上的路径。这在 IIS 中本地运行良好。但是,它在我们的 webapp 中不起作用,关于如何将子域指向 Azure 中的文件夹的任何建议?所有自定义域和证书都在 Azure 中正确连接,并且我们还有其他几个有效的规则,只是没有这个用于子域重写。

<rule>
<match url="*" />
<conditions logicalGrouping="MatchAll">
    <add input="{REQUEST_URI}" pattern="*://oursubdomain.*/*" />
</conditions>
<action type="Redirect" url="{C:1}://ourwebsite.com/oursubdomain/{C:3}" redirectType="Permanent" />
</rule>

感谢您的帮助

【问题讨论】:

  • 您看到的当前行为是什么?另外...您当前的自定义域配置是什么?主域名和子域设置在同一个 Azure Web App 上吗?为了帮助您,我们需要更多详细信息。
  • 我看到的是oursubdomain.ourdomain.com 显示与oursubdomain.ourdomain.com 相同的内容,而不是被重定向。 CNAME 也在 DNS 中正确设置。是的,主域和子域都设置在同一个 Azure Web App 上。我们所有其他规则都正常工作。
  • 认为我们想通了。看来您在重写子域时必须明确。我用 pattern="^oursubdomain.ourdomain.com$" 替换了 pattern="://oursubdomain.*/" ,现在看来它可以工作了。感谢您的帮助

标签: azure url-rewriting


【解决方案1】:

在 Azure 中重写子域时,您似乎必须明确。作为 Azure 已经在使用通配符来映射子域。将 pattern="://oursubdomain.*/" 替换为 pattern="^oursubdomain.ourdomain.com$" 规则现在可以正常工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-15
    • 2011-01-30
    • 2019-09-01
    相关资源
    最近更新 更多