Skip to content

Instantly share code, notes, and snippets.

@salsalabs
Last active May 6, 2020 14:14
Show Gist options
  • Save salsalabs/7475a358a2657dcd438e185180575920 to your computer and use it in GitHub Desktop.
Save salsalabs/7475a358a2657dcd438e185180575920 to your computer and use it in GitHub Desktop.
Script to find public-facing pages with HTTP (non-secure) URLs and change the URL to HTTPS (secure).
<!-- BEGIN Change non-secure action URLs to secure. -->
<script type="text/javascript">
if (/^http:/.test(window.location.href)) {
window.location.href = window.location.href.replace('http', 'https');
}
</script>
<!-- END Change non-secure action URLs to secure. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment