Created
December 16, 2016 14:50
-
-
Save Nils-van-Kleef/5a649a1a54b9b81b079ee24ff1f6fa34 to your computer and use it in GitHub Desktop.
Redirect: Strips href up to "www.", then Prepends https://www. and then executes redirect
This file contains 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
/* _optimizely_redirect=http://www.example.com */ | |
var toPrepend = "https://www."; | |
var hrefPostWWW = window.location.href.split("//")[1].replace("www.",""); | |
var newHref = toPrepend.concat(hrefPostWWW); | |
window.location.replace(newHref); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment