Password Protecting a Folder or Topic

What's covered?

This topic describes

  • How to password protect a folder in your webhelp output to stop unauthorised users from accessing certain topics.
  • How to password protect specific topics.

Password Protecting a Folder

Note that this method will only work on a Unix server.

Demonstration

Click this link and enter any username and password except those below.

Now try with username pumpkin and password pie (case sensitive).

Once you have got into the demo page, you will be able to go to it again in the same session without being prompted for the username and password.

Close Internet Explorer and then try again. The username and password will be required.

Method

You need to create three files:

.htaccess

.htgroup

.htpasswd

Note the dot in front and that there is no file extension.

.htaccess

This file goes in the folder that is to be protected. It will look something like this:

AuthUserFile /path/.htpasswd

AuthGroupFile /path/.htgroup

AuthName Restricted

AuthType Basic

<Limit GET POST PUT>

require group secured

</Limit>

 

The path must be the full path from the root of the server. See .htpasswd and .htgroup for information about where to locate these files.

AuthName can be whatever you want. (Shades of Tina Turner's Private Dancer here!).

After "require group" add the name of your group. Again, that can be whatever you want.

.htgroup

This file is best put in a folder that is above the root of your site so that it is not accessible to anyone else. It will look something like this:

secured: userone usertwo

 

It comprises the group name as specified in .htaccess followed by the usernames for whoever is authorised to access the folder contents.

.htpasswd

This goes in the same folder as .htgroup. It will look something like this:

userone:encrypted password

usertwo:encrypted password

 

The password needs to be encrypted. Click this link to go to a site where you can enter the username and password to find out the encrypted version.

User pumpkin and password pie would be pumpkin:UjQAdKvQeyp3w

Comment

I hope this helps. I am no authority on the subject and suggest you search on .htpasswd for a whole host of sites that can provide far deeper knowledge.

I found this information by looking at Webmonkey. However they seem to have reorganised their site and I cannot now find the same topic. There is a similar topic you might like to look at on Freewebmasterhelp.

Password Protecting a Specific Topic

A common forum request is the ability to password protect content. What authors are looking for ideally is the ability to password protect whole areas. Gerry Palmer found a page on Adobe's site with many utilities including one that had a method of protecting individual topics that was written in 2002 and he produced a RoboHelp 9 project demonstrating the method.

I tried the Password utility and it worked in both WebHelp and Microsoft HTML Help. Click here for the RoboHelp 9 version of Gerry's project with instructions.

If your output is WebHelp, you may find that you need to generate with the Convert RoboHelp Edited Topics to HTML check box ticked.

Donations

If you find the information and tutorials on my site save you time figuring it out for yourself and help improve what you produce, please consider making a small donation.

Topic Revisions

Date

Changes to this page

08 Feb 2017

Topic reviewed. No changes made.

14 Aug 2016

Password Protecting a Specific Topic section rewritten as Adobe had pulled a page that was referenced.

10 Feb 2012

Content of Snippet 140 added to this page.

29 Jun 2011

Reference to Snippet 140 added.

28 Nov 2005

Amended during conversion of site to Dreamweaver. The Webmonkey article previously referred to seems to have been pulled.