Auto Redirecting to SSL Url

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




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;



Leave a Reply

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

You are commenting using your 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.