Created
May 28, 2014 22:47
-
-
Save mephraums/7a4ab59238fe2def9d95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
/* Create an anonymous function */ | |
(function() { | |
/* 1. Define default protocol */ | |
protocolToUse = "http"; | |
/* 2. Identify current page protocol */ | |
currentProtocol = doc.loc.protocol; | |
/* 3. Identify the protocol the page should use */ | |
if(window.location.domain.test(/ge\.com$/)) { | |
/* Staging, so use HTTP */ | |
protocolToUse = “http”; | |
} | |
else if(typeof useSSL === 'boolean') { | |
/* If a specific override is in place, use this */ | |
protocolToUse = useSSL; | |
} | |
else if(document.location.test('/form/')) { | |
/* If no specific override, see if it matches one of the ‘special’ folders */ | |
protocolToUse = "https"; | |
} | |
/* 4. If the current protocol is not the protocol to use, then change the location (including any querystring or hash) */ | |
if currentProtocol!=protocolToUse { | |
location = protocolToUse & domain & path...; | |
} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment