I decided that this is the easiest approach, at least for now), and it works for me:
I opened the Sitefinity/Login.aspx.cs and added the following code (
found here, originally) to the page_load:
| //this is the current url |
| System.Uri currentUrl = System.Web.HttpContext.Current.Request.Url; |
| //don't redirect if this is localhost |
| if (!currentUrl.IsLoopback) |
| { |
| if (!currentUrl.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.CurrentCultureIgnoreCase)) |
| { |
| //build the secure uri |
| System.UriBuilder secureUrlBuilder = new UriBuilder(currentUrl); |
| secureUrlBuilder.Scheme = Uri.UriSchemeHttps; |
| //use the default port. |
| secureUrlBuilder.Port = -1; |
| //redirect and end the response. |
| System.Web.HttpContext.Current.Response.Redirect(secureUrlBuilder.Uri.ToString()); |
| } |
| } |
Any potential problems with this approach, other than the fact that it's assuming you have SSL setup on the site? I'm thinking that can easily be overcome by introducing a variable in the web.config that says something like
RunAdminOverHTTPS=true/false, which can then be checked in the code above. If true, then redirect, if not, don't....