Archive for August, 2006

about fixing the RSS feeds problem with iWeb using Apache RewriteRules. Here is an update for those using a web hosting environment where they do not have godly power over the Apache configuration files. I’ve recently transitioned to the former situation from the latter and I’ve had to adapt my strategy for dealing with this little bug a bit.

Side rant: WTF Apple? This RSS feed publishing bug is well known and well complained about and from a programming point of view is trivial to fix. People bitch about it in the forums, and it’s wrong, even though some of the forum dwelling sockpuppets keep saying that it’s perfectly alright to have to upload your site twice to make up for the broken links produced by otherwise nicely functioning software. So look, either your hosting service is broken or your software is broken. Just fix it.

Rant off.

So anyways, won’t work in an .htaccess file driven hosting environment. It has to do with the URI-to-filename translation handler phase of the Apache request chain. In my last commentary I suggested a RewriteRule (henceforth: RR) that looked like this:

RewriteRule ^/Example/(.*) /$1 [R,L]

To remove the spurious “Example” (or whatever you named your site in iWeb) string from the URLs in the RSS feeds, and the links pointing to the RSS feeds. If you put that in the server configuration file that’s fine. The RR short-circuits the URI mapping phase and will happily redirect things from the URI-segment “Example” even though it does not exist (because iWeb does not create it, which is the whole reason for this little exercise). However, when including these directives in .htaccess files, this approach will not work because the URI-to-filename translation handler has already started and when it does not find the directory “Example” in your document root, it fails out.

There is a solution however. How it is executed depends on how you push out files to your hosting environment. What need to happen is that one needs to create a directory at their DocumentRoot called “Example” and place an .htaccess files in this empty directory with the following directives:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*) /$1 [R,L]

Using this approach the same thing will happen. Apache will find the bogus directory from the buggy URL and then the RewriteEngine will then take over and translate your paths such that they resolve properly.

It should be noted that while it might be tempting to just create this directory and .htaccess file on your local disc in your ~/Sites/sitename directory, there is a problem with that. Every time you publish your site, it will get over written by iWeb. So it has to be placed on your web host machine some other way. I just wrote a bit of shell script to create the directory and .htaccess file .

But really, iWeb should just be fixed so this is irrelevant.

I’m currently looking at RapidWeaver. This is becoming foolish.

Comments Comments Off