Jump to content

Htaccess: Difference between revisions

48 bytes removed ,  14 September 2008
No edit summary
 
Line 34: Line 34:


With the password file and protected directory in place all that remains is the .htaccess file to tie it all together. The .htaccess file is what will tell the Webserver that the directory is password protected and requires authorisation.
With the password file and protected directory in place all that remains is the .htaccess file to tie it all together. The .htaccess file is what will tell the Webserver that the directory is password protected and requires authorisation.
Click [http://www.redbrick.dcu.ie/help/tutorials/htaccess/htaccess.txt here] for a sample .htaccess file


Change to your protected directory by typing:
Change to your protected directory by typing:
Line 44: Line 42:


Copy and paste the contents of the sample htaccess file into the editor, making the necessary modification to the AuthUserFile line, e.g.  
Copy and paste the contents of the sample htaccess file into the editor, making the necessary modification to the AuthUserFile line, e.g.  
AuthType Basic
AuthName "User Login"
  AuthUserFile /home/member/g/gizmo/passwd
  AuthUserFile /home/member/g/gizmo/passwd
 
require valid-user


'''Note:''' keep the name of the file .htaccess - this is an actual file extension recognised by Apache and it must be used.
'''Note:''' keep the name of the file .htaccess - this is an actual file extension recognised by Apache and it must be used.
138

edits