Jump to content

Htaccess: Difference between revisions

204 bytes added ,  14 September 2008
 
(4 intermediate revisions by 3 users not shown)
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 43: Line 41:
Now type nano .htaccess to open the file in a text editor  
Now type nano .htaccess to open the file in a text editor  


Copy and paste the contents of the sample htaccess file into the editor, making the necessary modification to the AuthUserFile line, and save.  
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
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.
Line 49: Line 51:
Lastly we need to set the permission on the file by typing:
Lastly we need to set the permission on the file by typing:


  chmod 755 .htaccess
  chmod 644 .htaccess
 
== htaccess & pubcookie ==
 
You can use your htaccess file with the RedBrick pubcookie system. With this you can restrict access to redbrick members. See [[PubCookie on Redbrick]] for more.


== Testing ==
== Testing ==
Line 64: Line 70:


As always, you can contact [[Helpdesk]] if you have any problems.
As always, you can contact [[Helpdesk]] if you have any problems.
[[Category:Helpdesk]]
138

edits