Apache .htaccess files can be used to block access to specific resources, or to provide minimal security through user name and password authentication.
You can use a .htaccess file in any folder of your website, and it will apply to any subfolders. A single .htaccess file placed in the root of your domain can apply to the entire website. While this is advantageous for blocking access to files, you’re going to need a seperate .htaccess in each subfolder that you want to password protect.
Read the rest of this entry »
Several years ago, you made the grave error of putting an overly specific URL in some advertising (example.com/fall_2005_news.html
). You’ve come to your senses and are re-organizing your website’s structure, and you really want to get rid of that html file. You’d like any user attempting to visit that ancient URL to instead be shunted to example.com/news
.
Well, such a procedure is relatively easy. Apache .htaccess files can be used in any folder of your website, and will apply to any subfolders. Thus, a single .htaccess file in the root of your domain can apply to the entire website.
The aforementioned example is fairly simple, but URL rewriting of extreme complexity is possible once you know the rules. Generally, instead of simply changing file1.html
to folder/file1.html
using a single rule, you will instead change every file fitting the form fileX.html
to folder/fileX.html
. That is to say, any request for a file that matches a specific pattern will be rewritten to a new URL.
Read the rest of this entry »
Why a blog?
I’ve been meaning to set up a blog for a few years now. What held me back was mostly a feeling that nobody out there would really care what I have to say. I’ve since decided that I just don’t care. I’m writing this blog because I can, and its immaterial if nobody finds it useful. If they do, all the better.
What to expect
I’m not entirely sure where this thing will lead. To start the ball rolling, I’ve come up with a few topics that I’d like to write about.
Topics
- Programming
Coding, scripting, config files, its all good.
- Technology
My thoughts on technology.
- Philosophy
A broad topic, but I have a broad interest in it.
- Design
I can’t draw, but I can design!
- Reviews
If I own it or have used it, I’m going to talk about it here.
- Gaming
I’m not exactly a hardcore gamer at the moment, but I’ve been there.
- Miscellaneous
Everything else.