Created
October 15, 2009 20:28
-
-
Save lazyatom/211253 to your computer and use it in GitHub Desktop.
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
javascript:(function(){var%20local_hosts=['interblah','www.theauteurs'];var%20mapped_external_tlds=['net','com'];var%20hostname_parts=document.location.hostname.split(%22.%22);var%20tld=hostname_parts.pop();if(mapped_external_tlds.indexOf(tld)>=0){hostname_parts.push(%22local%22);}else{hostname_parts.push(mapped_external_tlds[local_hosts.indexOf(hostname_parts.join(%22.%22))]);};document.location.hostname=hostname_parts.join(%22.%22);})(); |
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
javascript:(function(){ | |
var local_hosts=['interblah','www.theauteurs']; | |
var mapped_external_tlds=['net','com']; | |
var hostname_parts=document.location.hostname.split('.'); | |
var tld=hostname_parts.pop(); | |
if(mapped_external_tlds.indexOf(tld)>=0){ | |
hostname_parts.push('local'); | |
}else{ | |
hostname_parts.push(mapped_external_tlds[local_hosts.indexOf(hostname_parts.join('.'))]); | |
}; | |
document.location.hostname=hostname_parts.join('.'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment