Forum Moderators: open
post where I got the script from here:
[webmasterworld.com...]
please note, this post has been closed due to age.
The line with <!--#if expr="${REMOTE_ADDR} isn't JavaScript but some sort of SSI (server side include) script. That means that your server has to be SSI enabled, and that you probably have to rename your page into somthing.shtml .
Using javascript to do things like this is like using sticky tape to secure your home. It may work, but it's very easy to hack. If possible, you should handle this on the server.
If you know of a javascript fix for this, that would be immensely helpful.
Thanks very much!
holodoctor1, if that server you're using has SSI enabled you can try with this:
create a new document and paste this code into
var ip = '<!--#echo var="REMOTE_ADDR" -->'
if(ip == '127.0.0.1'){
location.replace('accessdenied.htm')
}
Change de ip, of course and the url you want to redirect
save it as ip.shtm
Now, in the pages you need to block that ip put this line into the document head
<script language="JavaScript" type="text/javascript" src="ip.shtm"></script>
If your server supports SSI it will work ;-)
greetings