Last active
July 28, 2023 09:54
-
-
Save R4356th/82d1e2b6612ccc88313ea274ac6b9c4d to your computer and use it in GitHub Desktop.
JavaScript code to enforce https on your websites
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
/* Copyright 2020-23 Radman Siddiki | |
Licensed under the MIT License (https://www.mit.edu/~amini/LICENSE.md) */ | |
if (location.protocol === "http:") { | |
location.replace(location.href.replace("http:", "https:")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment