URL Rewrite not executed on Azure, several projects

坚强是说给别人听的谎言 提交于 2019-12-25 03:49:21

问题


I am trying to rewrite the URL on an Azure MVC application. The solution contains many projects, thus has web.config files all over the place.

The URL Rewrite objective is to send all URLs based on the Project "Statistics" to the subdomain "admin", whatever subdomain was called at the origin of the request. (I created this rule independently on my laptop with IIS Manager and imported it manually in one of the projects)

<configuration>
<system.webServer>

<!--Something here. The rule nests at the end of the block. -->

<rewrite>
<rules>
<rule name="Statistics">
<match url="[0-9a-zA-Z-]*.mysite.com/statistics/(.*)" />
<action type="Rewrite" url="https://admin.mysite.com/statistics/{R:1}" />
</rule>
</rules>
</rewrite>
</configuration>
</system.webServer>

So, I am wondering why this rule doesn't seem to be executed:

  1. Is the syntax correct?

  2. In which web.config file should I place this rule, considering that I have five projects in the Solution?

来源:https://stackoverflow.com/questions/53015347/url-rewrite-not-executed-on-azure-several-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!