在Microsoft Windows Azure上设置网站的默认网页

use*_*190 6 vb.net asp.net hosting azure

我最近在azurewebsites.net上建立了一个网站.

但是,当我去网址http:/website.azurewebsites.net/它没有加载.

但是当我去http:/website.azurewebsites.net/home.aspx它加载.

我想要的是,如果用户访问http:/website.azurewebsites.net/,它将加载home.aspx内容或重定向到http:/website.azurewebsites.net/home.aspx

这不起作用

 <system.webServer>
   <defaultDocument>
     <files>
       <clear />
       <add value="Default.aspx" />
     </files>
   </defaultDocument>
  </system.webServer>
Run Code Online (Sandbox Code Playgroud)

对不起这里的实际链接http://rathgarfantasyhockey.azurewebsites.net/default.aspx工作正常,但当你去http://rathgarfantasyhockey.azurewebsites.net HTTP错误404,The resource cannot be found显示.

谁能帮忙?

Kin*_*ake 7

根据这篇博客文章:http://blogs.msdn.com/b/cesardelatorre/archive/2010/07/22/how-to-set-a-default-page-to-a-windows-azure-web-角色的应用程序,Silverlight的ASP净etc.aspx

<defaultDocument> 
          <files>                           
             <clear/>                           
             <add value="Default.aspx"/>                      
          </files>
</defaultDocument>
Run Code Online (Sandbox Code Playgroud)

应该管用.或者您可以键入到Url映射它.要做到这一点,请查看http://msdn.microsoft.com/en-us/library/cc668201.aspx


Zac*_*ach 7

If you are using MVC or Web API, add the following line in RegisterRoutes():

   routes.IgnoreRoute(""); 
Run Code Online (Sandbox Code Playgroud)

This solved my problem. Hope it helps you.