Restricting Access to Your Web Pages

To restrict access to the web on a directory-by-directory basis, use a .htaccess file. This file can contain a variety of apache directives, but is most often used to restrict access.

Information on password protecting your web pages is elsewhere.

Here's an example of restricting access to all pages in a subdirectory to only the brown campus.

  1. Cd to the directory you would like to restrict
  2. Create a file named .htaccess
  3. Put this line in it:
    	Require ip 128.148.0.0/16 10.0.0.0/8
    

The .htaccess file tells apache who can access your web pages.

For more details on the syntax of htaccess files, see the Apache web server documentation. (Hint: look at the Apache Directives page).