[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] How to force httpS for a directory--RaQ4



> Came across this JavaScript:
>   <script language="Javascript" type="text/javascript">
>       var loc = document.location.toString();
>       var index = loc.indexOf(":");
>       var url = loc.substring(index,loc.length);
>       if (index == "4") {
>          secureUrl = "https" + url;
>          location.replace(secureUrl); // get rid of current page in
> history
>          location.href = secureUrl;
>       }
>    </script>
>
> I haven't tested it.

I have now and it works a treat - Dan you are the man - thanks you've saved
me a lot of time and found a simple solution that just gets inserted into a
page - I dropped it at the top made no changes to the file and voila an
instant redirect to https for any page as needed.

Thanks again

Gavin