Singing the .htaccess Blues
Posted by Anna Belle on 13 Aug 2007 | Tagged as: Church Websites, Web Hosts, Web Tools
Sooner or later, any aspiring webmaster worth her salt is going to come into contact with the .htaccess file. The best response to this is to say, “On Guard!” It’s one tricky rascal of a file to deal with, particularly if you are on a Mac.
You’ll read that it’s powerful. True. And you’ll read that it’s easy. Also true. But that’s only in a limited sense. Among other things it’s easy to hose your whole site with it. I should know. I’ve done it twice in the brief life of this blog. The first time I knew instantly, and probably none of you saw it. The second time was Saturday, and for 18 hours it slipped under my radar. Horrors!
I knew I’d altered the .htacess file and I knew I was playing with fire, but I also double-checked and thought all was well. Wrong, wrong, wrong. The home page was fine. Everything else disappeared, while I blithely went to a wonderful oh-so-Nashville concert and got a good night’s sleep. Yesterday I awoke to an email from a dear friend politely inquiring about the state of my blog. I knew in a trice what the problem was. The dreaded .htaccess file. Fortunately, I was also able to fix it in a trice.
I’ll tell you why I was monkeying with the .htaccess file in an upcoming post, but before that, I think a very brief discussion of what it is, why it matters and why it’s such a slippery beast is in order.
What The Heck Is An .htacess File?
First off, it’s an Apache thing. Most of you (whether you realize it or not) probably are using servers running Apache. If your server uses some other software (the most likely alternative being Microsoft’s IIS), you may happily ignore this post.
Second, even if it is Apache, depending on how the sysadmin (system administrator) has configured your server, you may or may not be able to use it. Usually you can, but in highly secured environments you can’t.
Sysadmins can control the things you do with Apache in other ways, which are more efficient and safe than .htaccess. However, most sysadmins aren’t at the beck and call of your average webmaster. If you are using an inexpensive host (a likelihood for most church sites), then you won’t have easy access to the sysadmins, but chances are they will let you use .htaccess.
So now, with those caveats aside, the .htaccess is a text file that controls the configuration of all the files in its directory and child directories, unless the child, as growing children are wont to do, sprouts its own .htaccess file with a countermanding directive.
Most often, I alter an .htaccess to route users to a more friendly page-not-found message than the standard, bleak 404. I also have altered it to control password access to a portion of a website and to speed up response time.
Sample .htaccess Commands
Now for some examples of the commands you can add to your .htaccess file. These snippets of code take up one line each of the file. All you have to alter are the strings in italics (and be sure not to use the quotation marks).
To Disable Directory Browsing (a good thing to do)
“Options All -Indexes”
Change the Default Page
“DirectoryIndex myhome.htm index.htm index.php”
Redirect to a New Page
“Redirect oldpage.html http://www.domain.org/newpage.html”
Redirect to a New Directory
“Redirect /olddir http://www.domain.org/newdir/”
Redirect to a Customized Error Page (another good thing to do)
“ErrorDocument 404 /notfound.html”
Pretty cool to be able to do all of those things, huh? But….
Why .htaccess Is So Crazy Making, Especially On a Mac
First notice that this file name is in fact only a file extension. Nothing precedes the period – and the period is crucial. Upload a file named “htaccess” (instead of “.htaccess”) and it won’t do a thing.
On a Mac, this means you normally won’t be able to even see the file, much less create it. One way Apple protects its machines from user error is to hide system files, including ones that begin with a period. I usually get around this by using either TinkerTool or the “File / Open Hidden” command in BBEdit. Oddly enough, Dreamweaver can see the .htaccess file locally on my machine, but not remotely on the server. For that I use Cyberduck.
However, not only is the .htaccess file hard to find for many of us, it’s hazardous. It turns out you can do much worse things than I have done, such as set up infinite loops. Read some of the official documentation for Apache 1.3 if you’d like a sobering experience.
Also, unbeknownst to you, programs you use like WordPress may be altering your .htaccess file. If you overwrite them, your site will stop working. That’s what I did Saturday. I accidentally overwrote a WordPress directive.
Precautionary Measures
To avoid the pitfalls, there are four things to do.
First, on your server find the .htacess file in the appropriate directory of your site, download it and back it up before you alter a thing.
Second, be clear on your environment. Know not just if you are running Apache, but what version. And be sure to track down your host’s documentation about .htaccess. It can be a goldmine. See, for example, my host’s documentation.
Third, read up on a particular command before you upload a change to the .htaccess. It’s kind of like getting a second opinion for an illness.
Finally, don’t just double check after you upload an altered .htaccess file. Triple check. Try it in another browser and test several pages in different subdirectories.
While I don’t mean to frighten you unduly with talk of illness and hazard, precaution is the key. Using .htaccess wisely can do many great things for your site that you wouldn’t be able to do otherwise, so get to know it and handle with care.
Count Your Google Account: One, two, three great tools… Ah, ha, ha!
Posted by Anna Belle on 31 May 2007 | Tagged as: Web Tools
I was about to do an article on Google Analytics, when I realized some of you might not have a Google Account. Perish the thought, but to cover all eventualities, that’s the first step. The thing is, once you do get an account, you’ll have access to a bonanza of other Google tools. While Analytics is enough of a reason in itself for this church web diva, it seemed prudent to cover the big picture first.
How To Get Your Own Google Account
There are two steps. First you go to the Accounts page:
In the lower right corner, you click on “Create an account now,” fill in a few straightforward fields, and you’re off. That’s it. I promise.
Then What?
In priority order, here my favorite Google Account tools.
- Google Analytics.
It’s as good as or better than many of the high-priced website number-crunching tools. - Google Reader.
I’ve tried any number of blog and RSS readers to stay on top of what’s happening in the web development world, and for my needs (multiple machines and platforms) Google Reader is hands-down the best. And, zounds, now you can even get it offline. - Gmail.
It’s just another email account, but it’s got the power of Google search built in. So you can use it for things like webmaster and religious mail lists. Over time you’ll build up a data bank of very useful information. Need to choose a host? Quick – search your Gmail account and see whom trusted others recommend. - Google Groups.
This is the old Usenet, dating back to 1981, and thus crammed with information on every imaginable topic. You can also set up your own groups. For example, I might set up a redesign group while we’re overhauling our church’s site. - Blogger.
Blogger makes it so easy to set up a blog. Whether you use it yourself or not, it’s good to have in your toolbox. You might want to recommend it (or not) to someone in your congregation who’s considering blogging. - Docs & Spreadsheets.
Have you ever wanted to publish a spreadsheet on the web? Or collaborate online on a document? It’s incredibly easy with Docs & Spreadsheets. See, for example, my church’s redesign roadmap - Google Alerts.
Do you want to keep track of what’s being said about your church – on the web, in blogs, in the news? There’s no easier way to do this than Google Alerts. You can get them daily, weekly, or as they happen. - iGoogle.
Most webmasters know how to design their own home page, but still, this is fun and it can morph into your Google launching pad. It has hundreds (maybe thousands) of widgets (“stuff”) you can add. Watch out, though. It can be a huge waste of time. It’s kind of like getting sucked into a candy store and eating a bit too much. - Calendar.
Calendars are surprisingly complex. I’ve not found Google’s calendar to be particularly helpful for my church’s needs, but that doesn’t mean you won’t. - Picasa Web Albums.
I don’t use them, because I’m not much of a photographer. But Mr. Web Diva does and swears by Picasa.
And if these aren’t enough for you, see Google’s own much longer list of options.
NB: lest you think I’m snubbing Google Webmaster Tools, they aren’t really part of the Account suite, though they seem to be moving in that direction. Also, they’re considerably less intuitive than all of the above, so I’ll save them for a future post.
Update 6/23/07: Be sure to check out Mark Alves excellent post on picking the best Google account for the job.

