Old feed URLs fixed with a bit of mod_rewrite voodoo

| 1 min read

As feeds are the new blogs (quoting myself, oh dear!) I thought it important to make sure that the feed bots that have been continuously polling my weblog’s feed and getting 404s (since 2005, I guess) are sent to the right place. My Apache access.log file was showing that 404s were being returned for /index.rdf and /index.xml, and /qmacro/xml for that matter … all old locations for the weblog feed.

The power of HTTP, and the voodoo of mod_rewrite, allow me to fix things. Inserting these lines into the relevant .htaccess files does the trick:

RewriteRule ^index.(xml|rdf)$ /feed/atom/ [R=301,L]

RewriteRule ^xml$ /feed/atom/ [R=301,L]

Now the bots are redirected to this weblog’s shiny new feed. And I’ll try not to change the URL again :-)