asp.net mvc 3には、ssl証明書があり、httpsで正常に実行されるサイトがあります。公開される唯一のページはログオンページです。何らかの理由で、httpsにロードされません。これが私の関連コードです(何かを省略した場合は、リクエストに応じてさらに投稿します)。
web.config
<compilation debug="false" targetFramework="4.0">
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" requireSSL="true"/>
</authentication>
global.asax
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Account", action = "LogOn", id = UrlParameter.Optional }
);
}
アカウントコントローラー
#if !DEBUG
[RequireHttps]
#endif
public class AccountController : Controller
{
public ActionResult LogOn()
{
return View();
}
}
ログオンビューが読み込まれると、Httpsにはありません。私は何を取りこぼしたか?