用于重定向的Azure规则引擎上的匹配模式



我们正在从netlify迁移到azure,我需要重新创建一些重定向,例如:

[[redirects]]
from = "https://www.aaa.jp/ja-jp/*"
to = "https://www.aaa.com/ja-jp/:splat"
status = 302
force = true

我尝试了Azure CDN和默认的Microsoft层,但运气不佳,因为在搜索了文档后,我仍然不知道如何匹配模式(如上面的*和:splat(。

如果您使用的是在windows上运行的Azure App Service应用程序,则可以在web.config文件中编写重定向规则,如本博客中所述。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect old-domain to new-domain" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="http://<<appdomain>>/{R:0}" redirectType="Permanent" />
</rule>              
</rules>
</rewrite>
</system.webServer>
</configuration>

最新更新