I call this the ".htaccess method" because you will be creating a file called ".htaccess" (note the dot that precedes the word). You will also create a ".htpasswd" file. To set up .htaccess password protection, follow these instructions:
- Log into UThink and select your blog from the dashboard. You should now see the name of your blog in a tab in the upper left corner, adjacent to "Write Entry". Double-check to make sure that you're not password-protecting the wrong blog.
- Go to Design > Templates
- Click on "Create index template"
- Give your new index template a name, "Htaccess file"
- In the body, paste in this code:
AuthUserFile /htdocs/blog/[your Internet ID]/[your blog directory name]/.htpasswd
AuthName "You need to log in to view this content"
Allow from all
But note that [your Internet ID] needs to be replaced with your x500. Similarly, [your blog directory name] needs to be replaced with your blog directory name. It might not be the same as your blog name. Look at the URL for your blog. The blog directory name is the last name in the URL. For example, in the URL http://blog.lib.umn.edu/heinz062/uthink-forum/, the blog directory name is "uthink-forum".
For individuals with custom URLs, your x500 might not even be in the URL. If your URL is http://blog.lib.umn.edu/myblog, then the first line of the .htaccess file should read:AuthUserFile /htdocs/blog/myblog/.htpasswd
- Before you save, expand the Template Options menu (if it's not expanded already.) In the "Output File" field, type: .htaccess
Don't forget the period.
- Now click Save.
- For the following steps, you'll need an encoded password. Use this htaccess password generator to encode the password you want to use. You'll get something like this: goldy:I2ZU0L1SBgrMw
We'll use this in a moment.
- Go back to Design > Templates, then click on Create Index Template again.
- In this second template, call it "Htpasswd file"
- In the body, paste in the password that you generated before. It would look something like: goldy:I2ZU0L1SBgrMw
- Expand the "Template Options" menu if it's not expanded already. In the Output File field, type: .htpasswd
- Save your new template
- Re-build your entire blog site.
That should do it! Now your blog is password protected.
Note: it is possible to protect your blog with x500 authentication, just like other U of M web services. Search this forum for the words "password" and "x500".