We have a self-hosted DNN 6.01.03 site, in Windows 2003x64, std.
We have enabled it to use SSL, but we would like to set it up so an user coming through HTTP gets redirected to HTTPs.
Is there a way to do that? It seems that in IIS7 we could use the IIS Rewrite URL module, but this is IIS6.
Please advise. Thanks.
The fastest way is to set the site to "Force SSL" in DNN.
I have noticed that the behavior is better when using a tool like UrlMaster from IFinity.com.au.
Set up a redirect page and point 403.4 errors there. The redirect page will be the only url that doesn't enforce SSL.
You can use pretty much any available web technology here.
Examples:
In ASP.NET, the redirect.aspx can be written in a similar way to which it is done in Classic ASP:
<%@ Page Language="C#" %>
<!DOCTYPE html>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Request.IsSecureConnection)
{
string query = Request.ServerVariables["QUERY_STRING"];
query = query.Replace("http:", "https:");
query = query.Replace("403;", "");
query = query.Replace(":80", "");
Response.Redirect(query);
}
}
</script>
<html>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Redirecting...
</div>
</form>
</body>
</html>
To help others: The answer here comes in 2 parts from 2 different people:
1) As Mitchel state, go to your DNN site setting, Enable SSL and Enforce SSL. Site Settings > Advanced Settings > SSL Settings > Check both, "Enable SSL and Enforce SSL"
2) As Bruce pointed out, you then have to go to each page and make it a secure page. Page Settings > Other Settings > check "Secure". I had to do this for all of the pages... even Site Admin and Settings Pages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With