Coupon code copied
Server Intellect
(855) 850-HOST

Toll Free 24/7/365        (4678)

Get help from a Microsoft Certified Engineer.

Intellect Connect

Technical problem with your Windows Hosting?

Let our Microsoft Certified experts handle the problem for you.
Chat Now

How do I Configure my Site to Require SSL and HTTPS redirect?

You can force a site to use HTTPS several different ways. List here, are 2 examples: Force SSL through IIS and Programming an HTTPS redirect.

To Force SSL Through IIS:

Open IIS and right click on the site you wish to redirect from. Select the Directory Security tab and click the Edit button under the Secure Communications heading. Check the Require Secure Channel (SSL) option.

* This will only allow those who browse to the site view it over HTTPS. Anyone who does not, will receive a 403.4 error.

This can then be redirected to the HTTPS URL using the following procedure:

Create a file called “redirect.html” in the wwwroot folder and place the following code in the file(note: change the “url=https://webaddress/” line to match the customers requested URL):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<html>
<head> 
<title>HTTPS Redirect</title> 
<meta http-equiv="REFRESH" content="1;url=https://webaddress/"></HEAD>; 
<BODY> 
Loading ... 
</BODY> 
</HTML> 

Go back to IIS, right click on the site and select properties. Click on the Custom Errors tab and edit properties of the 403.4 error. Change the File location to point to the “redirect.html” we created.

You can programmatically force your webpage to use SSL by using the following code in your page:

VB.NET

If (Request.ServerVariables("HTTPS") = "off") Then 
Response.Redirect("https://www.website.com") 
End If 

C#

if (Request.ServerVariables["HTTPS"] == "off") 
{ 
Response.Redirect("https://www.website.com"); 
} 

Interested in letting our experts solve your IT problems for you?
Get a free, no-obligations consultation with one of our experts today!

Call us at (855) 850-HOST

Chat Now

Start Your Order

X

This form does not accept free e-mail accounts. Please enter a business e-mail to submit it.

Submit Form Cancel

Please wait...

Submitting your info. This may take less than a minute.