Force script run SSL with ASP

If you are passing sensitive data, you want to force the client's browser to use SSL(https) and you have SSL installed, you may use .
  1. Save the following code in the root folder of your Website as an include file named

  2. For each ASP page that requires SSL, insert the following code at the top of the page to reference the include file from the previous step:

  3. When each ASP page is browsed, the ASP code contained in the include file will detect the port to determine if HTTP is being used. If HTTP is being used, the browser will be redirected to the same page using HTTPS.

Add Feedback