Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Password Protecting Website
Carson
post 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.
Go to the top of the page
 
+Quote Post
rvalkass
post Dec 27 2007, 09:35 AM
Post #2


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,056
Joined: 28-May 05
From: Hertfordshire, England
Member No.: 7,593
Spam Patrol



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.
Go to the top of the page
 
+Quote Post
Carson
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Tutorial Website(13)
  2. Games For Website(15)
  3. What Website Do You Find Your Always Goin Back To?(77)
  4. Oldest Website?(37)
  5. How To Make Website Popular(27)
  6. Poster Website(1)
  7. Website Building Tips(8)
  8. Need A Webmaster For Your Website?(3)
  9. Un-filtered Browsing(0)
  10. The Devils Forum(6)
  11. How Do I Make A Website(16)
  12. How To Track Your Website Visitors. Free Excellent Tool!(0)
  13. A Website With Features To Promote Your Sites(0)
  14. My Website(17)
  15. How To Improve Security Of Your Website?(3)
  1. Xhaloforums(3)
  2. Favicon - Icon For Website Bookmark(14)
  3. Need Help Naming My Website(13)
  4. What Is Your Website About?(11)
  5. Image Board Software With Password.(4)
  6. Create You Own Operating System(4)
  7. Proxy Website(2)
  8. Home Page Startup(6)
  9. Can Your Website Be Deleted?(5)
  10. Make You Own Website Toolbar ^^/(1)
  11. How To Make A Website ?(6)
  12. Images For Website(0)
  13. How To Manage The Database For E-books Website In My Sql?(3)


 



- Lo-Fi Version Time is now: 26th July 2008 - 04:13 PM