Solved

Password protecting a webpage

Posted on 2009-03-30
3
275 Views
Last Modified: 2013-12-12
Hi,
I would like to set up a page in Wordpress for a website.  It will sit on the server like:

http://mysite.com.au/wordpress  for example

I would like to password protect this section of the site, so if someone trys to go to this folder they will be prompted for a username and password.

I would like to know the best way to do this, and whether or not is possible to set up different usernames and passwords for different users or if I can only have one username and password?
0
Comment
Question by:Amanda Watson
3 Comments
 
LVL 29

Assisted Solution

by:QPR
QPR earned 100 total points
ID: 24025603
depends, what is the operating system on the server and how much access do you have to set folder properties?
Were this windows I would say you would remove anonymous access from the folder that contains the page(s) and create users (or a group) that will be allowed access. Turn on integrated authentication and they will be prompted for a username/password.

Otherwise if want to put the protection into your code itself then create a login page and check the values against those you have stored (in a database of text file (risky)) if they are verified then set a cookie to say logged_on = true (or something) and redirect them to the page they want to go.

On the protected page check for a cookie value (logged_on) and if not true then redirect to the login page.
0
 
LVL 35

Accepted Solution

by:
torimar earned 400 total points
ID: 24025610
Yes, it is possible to set this up with different usernames and passwords.

Use the .htaccess/.htpasswd method.

Here are introductions:
http://weavervsworld.com/docs/other/passprotect.html
http://www.html-password.net
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 24025751
Thanks for the response.
I think torimars solution of the Htpasswd Generator is what I was after.
I have also discovered that wordpress actually have some plugins for this!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
The viewer will learn how to dynamically set the form action using jQuery.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question