Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2017 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/449c895ac34d2f89083547655a6c16a7 to your computer and use it in GitHub Desktop.
Save anonymous/449c895ac34d2f89083547655a6c16a7 to your computer and use it in GitHub Desktop.
(function(){
if( document.referrer )
{
var tag = document.createElement('a');
tag.href = document.referrer ;
[
[ ['123.com','www.123.com'] , '111.com' ],
[ ['456.com','www.456.com'] , '222.com' ],
].forEach(function(e){
if( e[0].indexOf(tag.hostname) != -1 )
location.href = 'http://' + e[1] ;
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment