【问题标题】:How do I setup a subdomain in Azure to access a folder?如何在 Azure 中设置子域以访问文件夹?
【发布时间】:2013-11-23 19:18:50
【问题描述】:

我看到this video 并成功配置了一些域。

  • domain.com
  • www.domain.com
  • static.domain.com

domain.comwww.domain.com 工作正常。但是对于static.domain.com,我想做一些不同的事情。当我转到此域时,我想访问我的应用程序上的 Static 文件夹。

如何配置它,以便当我尝试访问 static.domain.com/all.js 时,它将访问我的应用程序的 Static 文件夹的内容?

【问题讨论】:

    标签: c# azure dns subdomain


    【解决方案1】:

    我只能通过 url 重写来做到这一点。该域似乎没有 cookie,所以我认为它按预期工作。

    <system.webServer>
      <rewrite>
        <rules>
    
       <rule name="Static" stopProcessing="true">
         <match url=".*" />
         <conditions>
           <add input="{HTTP_HOST}" pattern="^static\.(.*?)$" ignoreCase="true" />
         </conditions>
         <action type="Rewrite" url="/static/{R:0}" appendQueryString="true" />
       </rule>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-28
      • 2016-01-18
      • 1970-01-01
      • 1970-01-01
      • 2014-01-12
      • 2023-03-20
      • 2013-05-21
      相关资源
      最近更新 更多