I host codewiz51.com web site on webhost4life.com. I don't want to spend $40 on an SSL certificate, so I use the free shared SSL certificate. One of the problems is that the web address is different between the non-SSL and SSL access URLs and directories. For instance, you are on http://www.codewiz51.com/blog, but the SSL access is https://siteabc.mysite4now.net/starwars/yoda (this address will give you an error.)
In order to get around this problem, I've modified the event handlers for the default.aspx page on my main web site to show "(Secure)" appended to the html title element when using SSL.
Here's the relevant section of yoda.master. Noticed that I do not include a title tag in the head. Each content page supplies the title as a content string for the ContentPlaceHolder "head".
<head id="Head1" runat="server">
...
<asp:ContentPlaceHolder ID="head" runat="server" />
</head>
Here's the code I've added to default.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Url.ToString().Contains("https:"))
{
ContentPlaceHolder mpHeader = (ContentPlaceHolder)Master.FindControl("head");
HtmlTitle title = new HtmlTitle();
title.Text = @"Home (Secure)";
mpHeader.Controls.Add(title);
}
else
{
ContentPlaceHolder mpHeader = (ContentPlaceHolder)Master.FindControl("head");
HtmlTitle title = new HtmlTitle();
title.Text = @"Home";
mpHeader.Controls.Add(title);
}
}
protected void Page_PreInit(object sender, EventArgs e)
{
if (Request.Url.ToString().Contains("https:"))
this.MasterPageFile = @"~/starwars/yoda.master";
else
this.MasterPageFile = @"~/yoda.master";
}
The first routine, Page_Load, simply adds the correct title to the html for the page.
The second routine, Page_PreInit is more important. It modifies the path to the master page so that ASP.Net can find the file when using SSL.