Jump to content
xisto Community
Carson

Password Protecting Website

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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:

 

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:

 

user:dIYYk5PMZdA/M

Done. Try accessing one of the files and you should be asked for the username and password.

Share this post


Link to post
Share on other sites

can any one help me out in javaplzi dunno how to use m a student of class 9so plz help me out.....thnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Share this post


Link to post
Share on other sites

this website can help you step by step to make password acessing and also ip banning.it will guide you step by step and all the codings there. BTW you will need to have a ftp or php server. no free host site will work with this code. and when u enter the site the link to the password protecting will be there and very visibledynamicdrive.com rvalkass is also good,if your planning to use his i would say it would work fine :D

Share this post


Link to post
Share on other sites

hey i was just wondering,. is there any different kind of encryption that we can do or do we have to do it they way that you are telling us because if it is only that way then it wouldn't be all that bullet proof, would it?

Share this post


Link to post
Share on other sites

On the same topic as this, how do you go about setting up an actual registration system?Is there a free script for it or do you have to make it yourself?More or less I'm looking for one where people can sign up a username/password and access the site using that(after they are validated via email)

Share this post


Link to post
Share on other sites

hey i was just wondering,. is there any different kind of encryption that we can do or do we have to do it they way that you are telling us because if it is only that way then it wouldn't be all that bullet proof, would it?

As it has to work across all installations of Apache, a standardised encryption method had to be agreed upon. There are plenty of tools that will perform the encryption for you, but they all have to encrypt in the same way. However, as the password is stored in that file, you just need to make sure that read access to that file is only available to owner or group, and then no-one else will be able to read it.

On the same topic as this, how do you go about setting up an actual registration system?
Is there a free script for it or do you have to make it yourself?

More or less I'm looking for one where people can sign up a username/password and access the site using that(after they are validated via email)


There are pre-made scripts out there, and it depends how big a website you intend to have, along with resources available to you, as to which method is best. If you want people to be able to sign themselves up then a PHP based system is probably best. A quick search search:php login script yields many results for you to try.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.