Azure CDN for Azure 静态网站 301 重定向配置



我在 Azure Blob 存储中配置了一个前端网站,如下一篇文章所示:

https://learn.microsoft.com/en-us/azure/cdn/cdn-map-content-to-custom-domain

我已成功将此网站配置为与我的自定义域一起显示:

https://www.example.com

我现在正在寻找如何为以下配置正确的 301 重定向:

  • http -> 301 -> https
  • example.com -> 301 -> www.example.com

我读了本节:https://www.itinsights.org/Static-Websites-with-Azure-Part-4/#HTTP-to-HTTPs-redirection

但是在我的 Azure 门户中,我没有看到任何可以推送此 xml 规则或如何从界面配置重定向规则的部分。

<rule id="1111111" platform="http-large" status="active" version="0" custid="XXXXX">
<description>HTTP to HTTPS</description>
<match.request-scheme value="http">
feature.url-redirect code="301" pattern="/XXXXXXX/staticwebsitede/(.*)" value="https://www.staticwebsite.de/$1" />
</match.request-scheme>
</rule>

编辑在接受的答案之后,我已联系 Azure 支持人员,以查看是否可以迁移。 为了 www.example.com 重定向 example.com,我使用了域名注册的网络转发功能。

在该博客中,你需要选择具有高级 Verizon 层的 Azure CDN,才能获得 Verizon 规则引擎的优势。

有关更多详细信息,可以比较 Azure CDN 产品功能。目前,具有标准Microsoft层的 Azure CDN 还支持使用标准规则引擎进行URL redirect/rewrite

最新更新