Password Robot Blog

A weblog about managing websites (and a little program
that helps you password protect your website)

Password Protecting Your Website with Password Robot

Password Robot makes it easy to password protect your website. Here’s an overview of how to install the program and password protect a directory.

After uploading Password Robot to your server, run the automated installer and Password Robot is installed for you in less than a second.

Password Robot installation complete

You can login to Password Robot’s control panel and get started right away. Once you’re in, go to the “Directories” page and select the directory you want to password protect. Enter a group name and click the “Protect this directory” button.

Password protect a directory

That’s it, you’re done. You’ve just installed Password Robot and password protected a directory in less than five minutes.

Comments (0)

5 htaccess Tricks Every Webmaster Should Know

If you’re new to htaccess, here’s a quick introduction. Otherwise, here are 5 sets of htaccess directives every webmaster should know:

1 - Redirect Visitors While You Update Your Site

Update and test your site while visitors are redirected to the page of your choice:

order deny,allow
deny from all
allow from 123.123.123.123

ErrorDocument 403 /page.html

<Files page.html>
allow from all
</Files>

Replace 123.123.123.123 with your IP address. Also replace page.html with the name of the page you want visitors to see.

2 - Display a Custom 404 Error Page

Your server displays a “404 File Not Found” error page whenever a visitor tries to access a page on your site that doesn’t exist.

You can replace the server’s default error page with one of your own that explains the error in plain language and links visitors to your home page. Here’s how to use your own page:

ErrorDocument 404 /404.html

Replace 404.html with the name of the page you want visitors to see.

3 - Handle Moved or Renamed Pages

You’ve moved or renamed a page on your site and you want visitors automatically sent to the new page when they try to access the old one. Use a 301 redirect:

Redirect 301 /old.html http://yoursite.com/new.html

Using a 301 redirect also ensures the page doesn’t lose its search engine ranking.

4 - Prevent Directory Browsing

When there’s no index page in a directory, visitors can look and see what’s inside. Some servers are configured to prevent directory browsing like this. If yours isn’t, here’s how to set it up:

Options All -Indexes

5 - Create User Friendly URLs

Which of the two URLs below looks friendlier?

http://yoursite.com/about
http://yoursite.com/pages/about.html

When it comes to URLs, as long as the meaning is clear, shorter is always better.

With htaccess and an Apache module called mod_rewrite, you can set up URLs however you want. Your server can show the contents of “/pages/about.html” whenever anyone visits “http://yoursite.com/about”. Here are a few examples:

RewriteEngine on
RewriteRule ^about/$    /pages/about.html [L]
RewriteRule ^features/$ /features.php [L]
RewriteRule ^buy/$      /buy.html [L]
RewriteRule ^contact/$  /pages/contact.htm [L]

There’s a lot more to mod_rewrite and htaccess. Check out the links below for more details and tricks.

Additional Resources

Apache htaccess Ultimate Guide
Comprehensive guide to .htaccess
mod_rewrite, a beginner’s guide (with examples)
Stupid htaccess Tricks

Comments (30)

A Quick Introduction to htaccess

What are .htaccess files?

.htaccess files are plain text files you can use to make configuration changes to your server. Each line in a .htaccess file is called a directive. Directives are applied to the directory the .htaccess file resides in and any subdirectories within that directory.

How to create a .htaccess file

You can create a .htaccess file using any text editor. Windows Notepad or TextEdit for Mac OS X is a good choice. To create one, open your text editor, enter a few directives and save the file as .htaccess (with the period).

If your editor won’t let you save the file as .htaccess, name it htaccess.txt instead. You can rename it after you’ve uploaded it to your server.

Using .htaccess files

To put a .htaccess file to work, you have to upload it to your server.

Before uploading a .htaccess file, always make sure there’s isn’t one already in the directory you’re uploading it into. This can be tricky as many servers are configured to hide files with names that begin with a period. Here’s how to set up your FTP client to show .htaccess files.

Once you’ve checked for an existing .htaccess file, you can upload your file (in ASCII mode) into the directory you want to work with, overwrite the existing .htaccess file, or add the directives from your .htaccess file to the one that’s already on your server.

Now that you’re familiar with htaccess, here are 5 htaccess tricks every webmaster should know.

Comments (0)

Small Business Owners: Learn HTML - Save Time And Money

Ever needed to make a quick update to your website but had to wait for your web designer to get to it? Don’t wait another minute or spend another dollar for someone to change a few sentences for you— Do it yourself.

Learning the basics of managing your web site can save you time and money. And learning the basics begins with learning HTML.

Some might say, “Wait a minute, with great tools like FrontPage and Dreamweaver that build web pages for you, why bother?” Well, by learning the basics, you’ll at least have an understanding of how the pages those programs produce actually work.

You’ll also gain the confidence necessary to fix or update pages on your own. And, who knows, maybe you’ll want to start creating web pages on your own. The code you write will certainly be easier to edit by hand in the future.

Try this:

  1. From your Windows “Start” menu, click “Run”, type notepad, and click “OK”.
  2. Now, type this:
    <html>
    <head>
    <title>My title</title>
    </head>
    <body>
    <h2>My header</h2>
    <p>My paragraph</p>
    </body>
    </html>
  3. Click “File”, then “Save As”, and save the file on your Desktop as webpage.html.
  4. Now, on your Desktop, double-click the webpage.html file you just saved.

Congratulations, this is the web page you just created. Pretty easy, right? The good news is, it really doesn’t get much tougher than that— HTML is so simple, you can literally learn it in an hour or two. Here’s a good tutorial to get you started.

Learning HTML gets you well on your way toward managing your own site and saving money in the process.

Comments (1)