|
This example restricts access to users in the three USNH domains for Durham, Keene, and Plymouth. , plus the block of addresses reserved for UNH UltraNet customers using the Durham access point (UltraNet issues a password). It does not allow access by UNH users with some other Internet Service Provider. |
Here's the recipe:
- Create the .htaccess control file using your editor of choice, e.g., pico (Unix), Simpletext (Mac), or Notepad (Windows). Remember, Unix files that begin with a dot are special and do not show up in normal listings but require the "a" switch, as in: % ls -al OK, put the following in the 5-line .htaccess file. Each line begins in column 1. Exact case and spacing matter: order deny,allow deny from all allow from 132.177. allow from 158.65. allow from 158.136. 1st line indicates that deny directives come first, followed by any allow directives. 2nd line indicates the default is to deny everyone. 3rd line makes an exception to allow access for any browser within the unh.edu domain represented by the first two bytes of the domain address space. Note the use of the trailing period to indicate an entire domain. 4th line makes an exception to allow access for any browser within the keene.edu domain represented by the first two bytes of the domain address space. Note the use of the trailing period to indicate an entire domain. 5th line makes an exception to allow access for any browser within the plymouth.edu domain represented by the first two bytes of the domain address space. Note the use of the trailing period to indicate an entire domain. If you want to also allow access from the block of addresses reserved for Ultranet's UNH customers who use the Durham access point (Ultranet issues a password to such customers), then you need to include these statements as well: allow from 207.180.187. allow from 207.180.186. allow from 207.180.184. That would still exclude from UNH who was using another Internet Service Provider, such as AOL.
- Copy this file into the directory to be protected and give it world-read access: % chmode go+r .htaccess % ls -al Test it to make sure it works. This may mean asking someone at another site to try it.
- We also have a copy of this file without any HTML markup that you can display and save to disk.