psst.. this blog is on hiatus.

Migrating and redirecting RSS feeds to FeedBurner

FeedBurner is a superb service. I’ve recently consolidated my feeds and migrated all of them to FeedBurner, allowing me to reap all of the benefits of this excellent service.

The benefits of using FeedBurner are several, while the drawbacks are nil. Here’s what you get:

Stats on usage
This is the best feature! I was in the dark before; now I know exactly how many daily readers I have through newsreaders. I cannot glean this information from Analog. The service provides stats in chart or table form, breaks down the aggregator used, and allows you to upgrade to a Pro service with more interesting analysis.
Conserved bandwidth
You publish a private feed to FeedBurner which their crawler periodically downloads. Your readers download the feed directly from FeedBurner, saving your bandwidth.
Improved compatibility
FeedBurner allows you to publish a single, private feed which they’ll transform into a single public “SmartFeed.” This SmartFeed can be served in RSS 1.0, RSS 2.0, or Atom. No more need for you to publish separate files.

Migrating current RSS to FeedBurner (but always keeping your foot in the door)

After reading the above, you might say, “that’s great, but I don’t want to give up control of my feeds to an external service.” Well, you don’t have to. You simply use a temporary HTTP redirect to push your subscribers from:

http://yoursite.com/index.xml ? http://feeds.feedburner.com/newrss

It’s all described at the FeedBurner blog: Pointing an existing feed URL at your new FeedBurner URL. Continue to publish the URL on your site—which is not the private feed downloaded by FeedBurner but rather the previous, permanent location at which you used to publish your RSS locally—and you’ll continue to have control of your user’s subscriptions. Your users will subscribe to http://yoursite.com/index.xml, but each time their newsreaders update, they’ll redirect to the FeedBurner URL and download its RSS.

In the future, if you decide to discontinue using FeedBurner, you can toss out the HTTP redirect to the external FeedBurner site and use an internal HTTP redirect to link your public RSS URL with your still-published private RSS. Again, your readers don’t have to change a thing; the “front-facing” URL stays the same.

Consolidating existing URLs

One area the FeedBurner migration tutorial does not cover is consolidating local URLs. It assumes a 1:1 redirection relationship between an existing RSS/Atom feed and your FeedBurner feed. If you operate under this assumption, then you’ll end up with several local URLs pointing to FeedBurner. For example, let’s say you’re a typical Movable Type user and you’ve got an RSS 1.0, RSS 2.0, and Atom feed. Your redirection scheme would look like this:

http://yoursite.com/index.rdf ? http://feeds.feedburner.com/newrss(RSS 1.0)
http://yoursite.com/index.xml ? http://feeds.feedburner.com/newrss (RSS 2.0)
http://yoursite.com/atom.xml ? http://feeds.feedburner.com/newrss

That’s fine, but it’s a little messy. If you use FeedBurner’s SmartFeed option, which provides on-the-fly translation between syndication formats (RSS 1.0, RSS 2.0, and Atom), there’s a better way. First consolidate your local feed URLs first, then redirect.

http://yoursite.com/index.rdf ? http://yoursite.com/index.xml
http://yoursite.com/atom.xml ? http://yoursite.com/index.xml
http://yoursite.com/index.xml ? http://feeds.feedburner.com/newrss

And the htaccess code you’ll need…

RewriteRule ^index\.rdf$ /index.xml [R=301,L]
RewriteRule ^atom\.xml$ /index.xml [R=301,L]
RewriteRule ^index\.xml$ http://feeds.feedburner.com/newrss [R,L]

One note: You’ll notice the “R=301″ flag above. That’s because I’ve indicated that index.rdf and atom.xml should be permanently redirectly to index.xml. (I’m never going to publish a file at “atom.xml” or “index.rdf” again.) The “R” flag (“R=302″ means the same thing) indicates a temporary redirect. You can change “R=301″ to “R” without hurting anything; this is just to strictly follow the HTTP standard.