Forum Moderators: open
I am a webmaster who isn't all that skilled in html & java - just enough to get by. I want to block a person from visiting my website (I know they do not have access thru any other pc than the library, so I know it'll be effective).
I've seen out there that you can use an htaccess file, but I don't think that is for me, since I do not have the directory it says to put it in (I use MS Frontpage, so I'd imagine I am on some sort of Windows server). I've seen where you can enter a java script in your html...but does that have to be done on every page, or just the top level index.html page?
And I am also confused about the actual IP #s. I have the primary and secondary DNS #'s for the person's web service provider, is this what I'd need to enter in the ****.xx.xxx.x blanks? Or can you only enter the 1st part and catch every address the provider has? (I don't know if we are allowed to post the provider's name or it's #s, or I would so someone could better help me).
Anyhoo...this is a cry for help...Help! :)
Barbara
For example, if you want to keep people from that IP block out of the /home/mysite directory entirely, your /home/mysite/.htaccess file would include:
deny from 123.456.789.123
Note that you can use partial IP addresses, to deny access to more machines, i.e.
deny from 123.456.789
which would deny access to all IPs in the .789 class of the 123.456 class.
(2) Which IP address to block? Use the one (or a relevant class) used by the MACHINE you want to deny access to. Each machine within the library environment will have its own IP address, and all of those machines will be within a single class, subscribed to by the library IT department.
(These are NOT the addresses of the DNS servers!)
For example:
-The library uses Earthlink as their ISP.
-Earthlink sold them 50 addresses within the 123.456.789 class (.1 - .50)
-In order to deny access to ALL of the machines at the library, your .htaccess file would include:
deny from 123.456.789.1
deny from 123.456.789.2
deny from 123.456.789.3
...etc...
deny from 123.456.789.49
deny from 123.456.789.50
In this type of case you would not want to deny access to the whole 123.456.789 class, because the library only leases a small number of IP addresses (50 out of a possible 254), and the rest might be legitimate clients.
Note that the web server must also include support for .htaccess files, something you should be able to find out from your hosting provider.
This method is MUCH more reliable than using Javascript on your pages, because all one would need to do to defeat a Javascript solution would be...to turn off their Javascript...unless you figured to keep out EVERYone who had their Javascript turned off!
If it is Windows, you can block the IP addresses in IIS. You will need to ask your host to do this for you if you don't have access to the machine, but what they would do is:
(1) Start MMC and load the IIS Snap-in, or load IIS Manager
(2) Find your site on the list and go to PROPERTIES.
(3) Hit the "Directory Security" tab and then hit the EDIT button on IP Address and Domain Restrictions. From there you can enter individual IP addresses or a range of IP's to deny. When this action is taken, the server won't respond to any HTTP requests from those IPs.