Skip to the content...

Welcome to the David Walsh Blog. I'm a MooTools, Dojo, jQuery, CSS, and PHP Web Developer located in Madison, Wisconsin, United States. Please contact me if I can make your experience on my website better.

.htaccess Tutorials

Fixing mod_rewrite and .htaccess on GoDaddy Hosting

I recently launched a new website on GoDaddy shared hosting. The website required mod_rewrite for SEO-friendly URLs. GoDaddy provides mod_rewrite but every time I tried to hit a two-deep URL, I would get a 404 error. Here's what I had:

Adding the XPI MIME Type for Firefox Extension Installs

Yesterday I posted version 0.1 of the David Walsh Blog Toolbar for Firefox. Unfortunately that led to an awkward conversation with my .htaccess file.

Improve Your YSlow Grade Using .htaccess

This post was authored by Eric Wendelin. To learn more about Eric, click here.

Quickly Set Up a Templating System Using .htaccess

Setting up a website capable of easy template switching probably sounds difficult. When I first thought about building a templating system, it felt like a pretty daunting task. After tinkering around for a few days, I found a way that would allow me to switch templates by simply changing a .htaccess directive.

Check For Module Presence in .htaccess

One of my favorite Apache modules is mod_rewrite. mod_rewrite allows me to manipulate page URLs so that I can search engine friendly URLs. Not every Apache server has the mod_rewrite module installed so you will want to add a conditional statement within your .htaccess file to make sure it's there.

.htaccess “Down For Maintenance” Page Redirect

I recently needed to move one website from a shared web host to our internal server. After some discussion, we decided to simply add a "Site Down For Maintenance" page to the site to prevent users from submitting orders during the hosting change. Using the following .htaccess code snippet, we were able to send all users to a maintenance.html page no matter which page they requested:

Force Secure (SSL) Pages With .htaccess

A while back, I shared a method for forcing a secure page using PHP. What if you want to force SSL (https://) on an entire website though? You don't want to have to put force-SSL PHP code on every page, right? Well, the website's .htaccess file comes to the rescue.

Password Protect a Directory Using .htaccess

Protecting files on your website from unauthorized users can be very important. Even more important is the method by which you accomplish this task. You could use PHP to listen for login authorization information on each page, but that doesn't protect your images, documents, and other media, does it? That's why I've found the .htaccess method of protecting files and directories the most reliable. Oh, and it's easy too!

No WWW Using .htaccess

There are some clear benefits to removing the "www" from your URLs:

Organized, Short Folder Structure Using mod_rewrite

I tend to be over-organized when I create the folder structure of my customers' websites. I like using descriptive file and folder names for a number of reasons:

Older posts »