Hi
I am implementing SSL for login page, but its implemented all pages. Even I unchecked 'Require SSL' in SSL Settings.
* IIS Configuration process:-
1) Created Self-Signed Certificate.
2) Done binding process.
Now after binding process it will take https for all pages. Even I didn't check 'Require SSL' in SSL Settings. I want to apply ssl (https) only for the login page not all pages.
* Also tried this code:-
Added this code on PageLoad event in login page. But its not working.
if(!HttpContext.Current.Request.IsSecureConnection)
{
Response.Redirect(Request.Url.Replace("http://","https://"),true);
return;
}
Please tell me how to do that. Any help would be greatly appreciated.
Thanks.
Loading

Kunal VaishyaPosted Dec 5, 2014, 5:54 AM
Datta KharadPosted Dec 5, 2014, 5:25 AM
Kunal VaishyaPosted Dec 5, 2014, 1:01 AM
Try this below code, My be it will help you.
var _Url = HttpContext.Current.Request.Url;
var secureUrlBuilder = new UriBuilder(_Url);
secureUrlBuilder.Scheme = Uri.UriSchemeHttp;
secureUrlBuilder.Port = 80;
HttpContext.Current.Response.Redirect(secureUrlBuilder.Uri.ToString(), true);
Regards,
Kunal