Auto Redirecting to SSL Url

Put following in the default document of your webserver, and it will auto redirect to https://

<html>

<body></body>

<scripttype=”text/javascript”>

var url = “”;
if (window.location.href.toLowerCase().indexOf(“http://&#8221;) > -1)
 url = window.location.href.replace(“http://&#8221;, “https://&#8221;);
if (url.toLowerCase().indexOf(“default.asp”) == -1) {
 if (url.substr(-1) == “/”)
  url = url + “/”;
  url = url + “default.asp”;
 }
window.location.href = url;

</script>

</html>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.