Archive for September 14th, 2005

Small .htaccess tip

Okay, okay, I know that the ability to use .htaccess- to change the default directory page is a pretty basic trick. But this is the first time I’ve tried it. And I am quite pleased with the results.

How does it work?

Tired of having come up when you go to Want to change it to be that comes up instead? No problem!

DirectoryIndex filename.html

This would cause filename.html to be treated as your default page, or default directory page. You can also append other filenames to it. You may want to have certain directories use a script as a default page. That’s no problem too!

In my specific case, many years ago I set up my personal blog through Blogger. At the time, I didn’t know what I was doing, so I set Blogger to save this file at This worked fine for a while. But then I decided that I wanted to shorten the URL for my personal blog down to just (much like this blog is The problem is, after five years of keeping my blog in one spot, more than a few people have this bookmarked. And I don’t want to alienate my readers!

I’ve toyed with doing a few different things, such as creating a link from blogger.html to index.html. My hosting provider doesn’t allow this, however. I considered mirroring the two files, so a change to one would reflect in the other. But I’d have to do that locally, ftping the changes, which would introduce lag time there.

And then, as I was headed out the door from work last night, a light went off over my head. “.HTACCESS!!!” It took me less than a minute to make this change! And it works flawlessly. Screw index.html: I simply added blogger.html as the DirectoryIndex for /thoughts and *presto*!

Now don’t I feel silly for not thinking of this a long time ago!

Profile picI am a 40-ish uber-geek, Daoist and family man. Blessed to have one incredible wife and three wonderful kiddos. Dao has been kind to me.

September 2005
« Aug   Oct »
QR Code
Top categories