mod_rewrite for Radio Userland Refugees

It seems that my .htaccess frenzy was pretty successful. 404 returns are way down. And most of those seem to come from search bots that glommed onto transient Textpattern url modes during the migration.

Here is how I support my old Radio Userland urls:

  1. First, configure Textpattern for the year-month-day-title url mode on the admin page. This minimizes the difference between Radio urls and Textpattern urls.
  2. Redirect the daily pages to Textpattern. Textpattern year-month-day-title mode will mostly handle the monthly archive pages (it misses when explicitly called as index.html).
1
2
3
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2}).html$ \
http://ideoplex.com/$1/$2/$3 \
[R=permanent,L]
  1. Redirect Radio Userland category pages (both monthly archive and daily) to the corresponding Textpattern url.
1
2
3
4
5
6
RewriteRule ^(sports|software)/([0-9]{4})/([0-9]{2})(|/|/index.html)$ \
http://ideoplex.com/$2/$3/ \
[R=permanent,L]
RewriteRule ^(sports|software)/([0-9]{4})/([0-9]{2})/([0-9]{2}).html \
http://ideoplex.com/$2/$3/$4 \
[R=permanent,L]
  1. Finally, I redirect the old rss feed to my new atom feed. This probably causes some breakage to newsreaders that don’t support atom, but Textpattern’s rss support is stuck back at version 0.92.
1
2
3
RewriteRule ^rss.xml$ \
http://ideoplex.com/atom \
[R=permanent,L]

Note: I’ve split each RewriteRule across 3 lines for greater readability.