|
|
|
|
![]() ![]() |
Dec 27 2007, 05:52 AM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 340 Joined: 29-April 07 Member No.: 42,353 |
I'm not sure if this is the right section to post this or not, i apologize if that is the case.
I am making a website for a friend, and he has asked me to have it so there needs to be a password to access it. I'm making the website in Dreamweaver, and its an html website. So I need to know how i am able to make it so you need a password to view the pages. I thought this wasnt possible with html pages, because if you know the link you can access any page. There would have to be something that redirects you unless there has been a password stored somewhere, right? I'm really unsure about this, and never done it before. Any suggestions are greatly appreciated. |
|
|
|
Dec 27 2007, 09:35 AM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,056 Joined: 28-May 05 From: Hertfordshire, England Member No.: 7,593 ![]() |
You can password protect a folder or files on your site using .htaccess and .htpasswd files. First, in the directory where the files that need protecting are, create a file called .htaccess and give it the following contents:
CODE AuthName "Password Required" AuthType Basic AuthUserFile /home/marked/.htpasswd AuthGroupFile /dev/null <Files file1.htm> require valid-user </Files> <Files file2.htm> require valid-user </Files> You'll need to change the file1.htm and file2.htm to the names of the files you want to protect, and you can copy and paste that Files section for each file you want to protect. Then, above the public_html folder (i.e. the root of your hosting account) create a file called .htpasswd . This will hold the username and encrypted password. Go here and enter the username and password you want people to use to access the pages. Leave the other two boxes blank. Then copy the DES encrypted version into your .htpasswd file and save it. Your .htpasswd file should just have something like this in it: CODE user:dIYYk5PMZdA/M Done. Try accessing one of the files and you should be asked for the username and password. |
|
|
|
Dec 29 2007, 09:51 AM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 340 Joined: 29-April 07 Member No.: 42,353 |
Thank you! Something like this is exactly what I was looking for. Thanks a lot.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 26th July 2008 - 04:13 PM |