2015-05-14 32 views
0

並行Plesk沒有在我的域名上打開默認頁面,而我在默認目錄中設置了它,而是打開了我的ASP.NET Web應用程序的登錄頁面。然而,一旦我通過提供正確的憑據登錄,它就會在我的域名上打開默認頁面。 這裏是我的web.config文件:在虛擬主機ASP.NET中設置起始頁面

<system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <authentication mode="Forms"> 
     <forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH"></forms> 
    </authentication>  
    <httpRuntime targetFramework="4.5" maxRequestLength="20896" /> 
    <authorization> 
     <deny users="?"/> 
    </authorization> 
</system.web> 

<location path="UserPanel.aspx"> 
    <system.web> 
     <authorization> 
      <allow users="*"/> 
     </authorization> 
    </system.web> 
</location> 
+0

你在哪裏設置默認頁面? – Izzy

+0

Plesk >>網站&域名>>顯示高級選項>>虛擬目錄>>目錄屬性 –

+0

iis是你的主機嗎? – Izzy

回答

1

如果你正在主持在IIS(7或更高版本),內(您web.config)的<system.webServer>補充:

<defaultDocument> 
    <files> 
     <clear/> 
     <add value="UserPanel.aspx" /> 
    </files> 
</defaultDocument> 
+0

我想使UserPanel.aspx我的開始頁面,這對我不起作用:( –

+0

嘗試將值更改爲UserPanel .aspx'(edited)? – mshsayem

+0

不能正常工作。問題是在登錄Login.aspx的表單上工作正常後,它每次打開域名上的UserPanel,但是如果我沒有登錄,它不會打開域上的UserPanel名稱 –