CW Automate – Force SSL Redirection

Quinntin Comer Uncategorized 1 Comment

Several directories and pages in the Automate installation are not forced to use SSL by default. The new, /Automate, web directory is SSL enforced by default. However, several key directories are not — /WCC2 is a prime example.

Previously, we would use IIS URL Rewrites to redirect to SSL if the current URL requested was not browsed too with HTTPS. Unfortunately, it appears that CW is overwriting the web.config file where these changes are stored. They have stated it is not a supported configuration and we have to do this in the default.htm file moving forward (unless we want to redo it after each update).

How to change it

Find the folder directory under C:\inetpub\wwwroot for the directory you want to enforce SSL on – i.e., /wcc2. Double click and edit the default.htm file with the following:

This will now capture the oldURL (the current URL you browsed to) and append https:// to the URL string and then redirect it.

<script language="JavaScript">
<!-- begin hide
function goElseWhere()
{
var oldURL = window.location.hostname + window.location.pathname;
var newURL = "https://" + oldURL + "WCC2/";
window.location = newURL;
}
goElseWhere();
// end hide -->
</script>

Comments 1

Leave a Reply

Your email address will not be published. Required fields are marked *