Skip to site navigation

Web support banner
Book Dreamweaver training
PHP
Apply for Apache account
MySQL 

.htaccess files

Apache uses htaccess files for local configuration.  You can use these restrict access to your pages, redirect to other pages, set up custom error pages.  htaccess files are just simple text files that contain only a few lines of text.

Use a simple text editor such as Notepad or SimpleText to create a file called .htaccess without any further extensions.  The file is placed within the directory that you want it to have effect on.

Restricting Access to Individuals

To restrict access to a directory to individuals you need to create a htaccess file with the following content:

AuthType Basic
AuthName "The UCL Intranet"
AuthDBMGroupFile /nfs/rcs/www/support/dbmauth/dbmauth
AuthDBMUserFile /nfs/rcs/www/support/dbmauth/dbmauth

require user userid1 userid2 userid3

where userid1 etc. are the userids of the people you wish to restrict access to.

Restricting Access to Groups

To restrict access to UCL groups you need to create your htaccess file with the following content:

AuthType Basic
AuthName "The UCL Intranet"
AuthDBMGroupFile /nfs/rcs/www/support/dbmauth/dbmauth
AuthDBMUserFile /nfs/rcs/www/support/dbmauth/dbmauth

require group ucl-staff ucl-pg ucl-ug

where ucl-staff etc. are UCL groups.  Further information about groups is available here.

Customised Error Documents

To set up custom error documents create your htaccess file with the following content:

ErrorDocument 404 /my-dept/my-errordoc.html

where /my-dept/my-errordoc.html is where you've placed your customised error file.



                                         


 


                    

Page last modified on 20 nov 13 10:16