Even though GoDaddy supports mod_rewrite, there are some definite peculiarities about their setup, with regards to .htaccess and PHP execution. Hopefully the observations I've made in this article will be of help if you're coming across the same problems I was.
UPDATE [9/Jul/2006]: .htaccess changes seem to be taking effect immediately now, at least for me.
UPDATE [3/Dec/2007]: According to comments left below, this is still an issue. I can't verify, though, as I stopped using GoDaddy ages ago. I've restored the stricken text, but please don't assume this information is still correct, as Your Mileage May Vary.
I was trying to set up Nucleus CMS and was having a little trouble with setting up the whole permalink / fancy URLs thing. In particular, the mod_rewrite stuff in .htaccess didn't seem to be working correctly.
Googling for htaccess rewriterule godaddy tells me that I'm not the only one who was having issues.
I managed to get it working, and there are a few things to note:
- Changes to the .htaccess file DO NOT TAKE IMMEDIATE EFFECT: I got very frustrated whem my rules were seemingly ignored, until I noticed that rules I deleted still worked. So, after making a cup of tea, I came back to find they all worked. I'm pretty sure this is the problem most people are having.
- Requests for PHP files (eg. http://gidden.net/tom/item.php) are intercepted well before .htaccess (and definitely mod_rewrite) activate. So, mod_rewrite will not work on URLs for PHP files.
- However, it will allow redirections to PHP files.
Like many of GoDaddy's services, the changes aren't instant: when you change a setting in the hosting manager, it often takes 10-15 minutes to happen. At one extreme, I moved the hosting package to another (non-existent) domain while shuffling things around, and it took 24 hours before it would let me change it back.
I think they must have a weird form of file distribution where the FTP servers are not talking to the same filesystem as the webservers, and a cron job performs some sort of mirroring. Either that, or there's some caching that doesn't get cleared correctly.
The fact that PHP files bypass .htaccess makes me think that PHP requests are separated out (possibly by some load-balancer or other magic box) and run on a different server. It's clear that PHP is run through the CGI/FastCGI mechanism, rather than the more usual mod_php/apache way, but I wouldn't necessarily expect a large-scale shared hosting site to use mod_php. It's a slight inconvenience, but understandable.
So, back to the Nucleus configuration. The "normal" way of doing fancyurls (using FilesMatch and ForceType magic) doesn't work on GoDaddy, since the PHP execution mechanism is long gone by the time Apache reaches the .htaccess file and ForceType. The alternative way listed in the documentation that uses mod_rewrite seems inadequate: it doesn't use the "Fancy URLs" mechanism in Nucleus, and the URLs really do feel less fancy as a result. Now that mod_rewrite seems to work correctly, we can use it to implement the extra/fancyurls files in a better way. I configured .htaccess as follows:
Options FollowSymLinks RewriteEngine On RewriteRule ^member/(.*) index.php?arr=member/$1 RewriteRule ^item/(.*) index.php?arr=item/$1 RewriteRule ^category/(.*) index.php?arr=category/$1 RewriteRule ^blog/(.*) index.php?arr=blog/$1 RewriteRule ^archive/(.*) index.php?arr=archive/$1 RewriteRule ^archives/(.*) index.php?arr=archives/$1
...and then changed index.php to sort this out in a big switch statement before handing over to selector().
There are other improvements to make, but I've now moved to WordPress instead. The WordPress permalink configuration seems to work fine, although as with Nucleus CMS it takes a few minutes for GoDaddy's servers to notice the changed .htaccess file.