DNN redirect to https

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.

1. Create a redirect page

You can use pretty much any available web technology here.

Examples:

  • client-side html/js (requires javascript)
  • Classic ASP

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>

2. Check that SSL is not enforced on the redirect page

Edit redirect.aspx propertis in IIS Manager

3. Point 403.4 errors to the redirect page url

enter image description here

See also:

  • asp.net c# redirecting from http to https
  • Automatically Redirect HTTP requests to HTTPS on IIS 6
  • IIS: Redirect from http to https

Tags:

Ssl

Dotnetnuke