I have a site that needs to be fully secured. However, I need to be able to switch all HTTP requests to use HTTPS, and I can't do this on the server as this application is a virtual directory under a website where other applications don't need this feature; hence, I can't do a site-wide redirect.
I have the following code in my global.asax, which I believe should work as I've seen samples elsewhere (and I am fairly sure it's used in our company without problems), but I am getting a "The given path's format is not supported." error.
protected void Application_BeginRequest(Object sender, EventArgs e)
{
// Force SSL if configured to do so.
bool useSSL = (ConfigurationSettings.AppSettings["UseSSL"].ToLower() == "true");
if ...
Go to the complete details ...