I am trying to create a site that when I am editing it the user will be redirected because its not on my ip. I have already created a script that should work but don't could someone please give me some pointers?
Javascript:
netscape = (navigator.appName.indexOf("Netscape") !=-1);
version4 = (navigator.appVersion.indexOf("4.") != -1);
if (netscape && version4){
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
if (ip.indexOf("some ip address")){
// Do nothing because its my ip
}
else{
window.location = "underconstruction.html";
}
}
This script should detect if the user is me by my IP, but if its not redirect the user to the under construction page! I also understand that you can do this in .htaccess but I am using dropbox for the main part of my hosting so I can't do it.
Any help would be appreciated thanks :-)