2016-11-22 20 views
0

我有converted一個簡單的HTML網站到Web應用程序。
enabled表單認證.aspx頁面現在需要login
但是舊的.html頁面仍然可以直接打開而無需登錄。
我必須將所有頁面轉換爲.aspx還是可以強制在.html頁面上登錄?IIS身份驗證可以阻止網站上的所有頁面嗎?

的Web.Config:

<?xml version="1.0" encoding="utf-8"?> 
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> 
    <system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" /> 
    <authentication mode="Forms"> 
     <forms loginUrl="login.aspx" name=".aspxFormsAuthentication" cookieless="AutoDetect" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="index.html"> 
     </forms> 
    </authentication> 
    <authorization> 
     <deny users="?" /> 
    </authorization> 
    </system.web> 
    <appSettings> 
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> 
    </appSettings> 
</configuration> 
+0

請更新您的問題到目前爲止您嘗試過的配置細節? system.web中的授權和身份驗證節點在web.config中的外觀如何? – Vinod

+0

如果這是針對整個IIS網站,是否禁用IIS中的匿名身份驗證? –

+0

ASP.NET Forms身份驗證是另一回事。 IIS身份驗證可以阻止一切。 –

回答

0

位置元素並沒有幫助。
看來這是不可能的,我確實需要將需要登錄的頁面轉換爲.aspx頁面。