将ASP.net URL重写到其他域

将ASP.net URL重写到其他域,asp.net,azure,url-rewriting,Asp.net,Azure,Url Rewriting,我试图在azure中重写到blob中的url以返回静态html,但它始终声明以下404.4错误: 请求的URL的文件扩展名没有处理程序 配置为在Web服务器上处理请求 模块:iiswebcore 通知:MapRequestHandler 处理程序:静态文件 错误代码:0x8007007b 这是我的web.config文件: <system.web> <authentication mode="None" /> <compilation deb

我试图在azure中重写到blob中的url以返回静态html,但它始终声明以下404.4错误:

请求的URL的文件扩展名没有处理程序 配置为在Web服务器上处理请求

  • 模块:iiswebcore
  • 通知:MapRequestHandler
  • 处理程序:静态文件
  • 错误代码:0x8007007b
这是我的web.config文件:

  <system.web>
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
    <httpHandlers>
      <add path="*.html" verb="*" type="System.Web.StaticFileHandler" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <validation validateIntegratedModeConfiguration="false" />

    <staticContent>
      <remove fileExtension=".css" />
      <mimeMap fileExtension=".css" mimeType="text/css; charset=UTF-8" />
      <remove fileExtension=".js" />
      <mimeMap fileExtension=".js" mimeType="text/javascript; charset=UTF-8" />
      <remove fileExtension=".json" />
      <mimeMap fileExtension=".json" mimeType="application/json; charset=UTF-8" />
      <remove fileExtension=".rss" />
      <mimeMap fileExtension=".rss" mimeType="application/rss+xml; charset=UTF-8" />
      <remove fileExtension=".html" />
      <mimeMap fileExtension=".html" mimeType="text/html; charset=UTF-8" />
      <remove fileExtension=".xml" />
      <mimeMap fileExtension=".xml" mimeType="application/xml; charset=UTF-8" />
    </staticContent>

    <rewrite>
      <rules>
        <rule name="static" stopProcessing="true">
          <match url="static/(.*)" />
          <action type="Rewrite" url="https://www.blobtest.blob.core.windows.net/static/{R:1}" />
        </rule>
      </rules>
    </rewrite>

  </system.webServer> 

我添加了一个httphandler和mimemaps,但仍然显示相同的错误。此外,如果我改变重写重定向它的工作,但这改变了我不想要的url


提前谢谢。

我今天刚刚遇到了同样的问题,结果证明,这是因为URL重写只有在同一个站点/web应用程序内重定向时才有效。请参阅以获得解决方案。提示:您需要安装ARR,并在ARR->服务器代理设置下选中“启用代理”框

希望它能帮助你。如果为时已晚,那么从互联网上出现这一问题的人数来看,我相信这将有助于其他人