skip navigation

This page looks better in modern browsers. Please upgrade.

Brown Home Brown Home Brown Home Brown CS

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. Note that you cannot alter the restrictions on the internal web, since it is already restricted, so you can only apply the restrictions to the outside web.

  1. Cd to the directory you would like to restrict
  2. Create a file named .htaccess.out (or whatever you like)
  3. Put these lines in it:
    	order deny,allow
    	deny from all
    	allow from .brown.edu
    
  4. Create a file named .private
  5. Add this line to it:
    	.htaccess .htaccess.out
    

Note that both of these files MUST be world-readable.

The .private file tells webupdate to copy the file .htaccess.out to the outside web as .htaccess.

The .htaccess file tells apache who can download 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).


Page Owner: John Bazik Last Modified: Thu Sep 26 18:11:22 2002