Created
July 8, 2013 01:21
-
-
Save thetrickster/5945621 to your computer and use it in GitHub Desktop.
Disable visitors of a certain country or countries access to your site by redirecting them to another page in Business Catalyst
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
var userCountryCode = "{module_visitorcountrycode}"; | |
var disallowedCountryCodes = ["US", "UK"]; | |
var redirectBlockedUsersURL = "/country-blocked.html"; | |
(function($) { | |
$.each(disallowedCountryCodes, function(i,val) { | |
if ( val == userCountryCode ) { | |
window.location = redirectBlockedUsersURL; | |
} | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment