Latest Additions
Official Forum
Vipey's Den - Official Blog
Quintessence
SuzyQ
GnomeyG
Nancy
Hedgehog's Audio
.htaccess Guide
Basic HTML Guide
Text and Links Guide
More Coming Soon!
Submit Your Work!
About
Comments
Bios!
Contact Info
GuestBook!
Site News
Copyrights
Links Page
Thereafter
Coming Soon!
Original Music Lyrics
Lyrics by Ben Drum
Eve 6 Lyrics
Unwritten Law Lyrics
RHCP Lyrics
Nine Days Lyrics
Writings by Viper37
Writings by Clyde
Writings by Rosanna Krich
Poetry by DragonFyre00
Writings by Chelsea
Writings by Scott
Writings by Infini-T-e
Writings by Hedgehog
Writings by Icebird
Writings by Kate LaKimbo
Writings by Ken Colwell
Rants
Reviews
Member's Area
School Area
Files
Forums
Web Hosting
|
Using a .htaccess file
Password Protecting your website using a .htaccess file:
This process is by no means simple the first time you attempt it, but I shall try to explain it in such a way everyone will be able to understand it.
Step one: create a folder/directory on your site that you want to protect.
Step two: create two files, one called htaccess and one called htpasswd. Both of these files need to be in plain text, with no file extensions. I recommend using BBEdit for this. For now, leave them blank.
Step three: place the following text inside htaccess as it is shown here:
AuthUserFile /home/evulaor/public_html/<yoursitename>/<foldertobeprotected>/.htpasswd
AuthGroupFile /dev/null
AuthName <relm>
AuthType Basic
require user <thenameofyouruser>
you can replace the last line, require user, with require valid-user if you want there to be more than one username and password availible. For <relm>, put something that describes the relm you are protecting, such as Member's Area. Save the file, and close it.
Step four: go to http://www.euronet.nl/~arnow/htpasswd/ and follow the steps to determine what your username and password line should be. Copy the line given to you into your htpasswd file. Repeat this mulitple times, one username and password per line, for however many users you have.
Step five: using the ftp client of your choice, upload the files into the folder you want to protect. UPLOAD THEM AS "PLAIN TEXT". I cannot stress this point enough. Encoding of any sort will ruin your files and they will not work. You will get many, many 500 error messages. If you're using Transmit, select ASCII mode under the file menu BEFORE you upload the files. If you use fetch, select both mode and format as text. If you use some other ftp client, figure it out yourself, but make sure you send it as plain text, no encodings, no fancy stuff. Just text. Once you've done that, rename both of the files so that their names start with a ".". They should now be called .htaccess and .htpasswd.
Step six: Create a page you want people to see when they get into your protected area. Name it index.html and upload it into the protected directory.
Step seven: Test to see if it's all working properly by going to the address of your private directory in a web browser. You should get a dialoge box asking for a username and password. After correctly entering these, you will be taken to the index.html page you uploaded.
Some notes: to modify one of the two files after uploading them, first delete them (the best way I've found is to use Fetch and select "delete a file or directory..." and type in the name. Then re-upload your files to the server. Most ftp clients will not display files that begin with a period by default. Furthermore, most servers are set up to never show .htaccess and .htpasswd files as being present, even if the ftp client has an option to display them.
There are many other cool things you can do with .htaccess files. For more infomation: Go to http://www.javascriptkit.com/howto/htaccess3.shtml and read the entire page. If you get really stuck, post a topic in the forums, email me, or contact me over AIM (my screenname is DeusEx37). Good Luck!
|