FeedBurner provides all kinds of neat stats, but it didn’t seem straight-forward to “burn” my blog feed since I’m using Drupal 5. After a little fiddling I think I’ve got a pretty good idea how to make it work in probably the simplest way possible. In fact, it doesn’t require and Drupal configuration at all.
- First I set up a FeedBurner account and burned my feed. The feed Drupal produces for me is:
http://ianloic.com/rss.xml. Now when I access http://feeds.feedburner.com/ianloic I get the contents of that feed. It’s pretty simple, but so far nobody is going to see that feed. - Then I simply told Apache to redirect all requests for that feed, except the ones from the FeedBurner bot to my FeedBurner feed. With the slight of hand magic of mod_rewrite this is pretty straight forward. In the root of every Drupal install there’s an
.htaccessfile containing a bunch of stuff. I just added a few lines to themod_rewrite.cblock of that file:# Rewrite rss.xml to http://feeds.feedburner.com/ianloic # unless FeedBurner is requesting the feed RewriteCond %{HTTP_HOST} ^ianloic\.com$ [NC] RewriteCond %{HTTP_USER_AGENT} !FeedBurner.* RewriteRule ^rss.xml$ http://feeds.feedburner.com/ianloic [L,R=301]This will cause Apache to send a 301 redirect to
http://feeds.feedburner.com/ianloicany time anyone requestshttp://ianloic.com/rss.xml, unless their HTTP User Agent begins withFeedBurner.Now I’ve got access to all the FeedBurner statistics and fun features. Since I didn’t actually touch the Drupal configuration I’m pretty sure a similar approach can be taken to applying FeedBurner to any feed.


One Comment
Drupal FeedBurner module Just wanted to let you know that I’ve been working on a Drupal FeedBurner integration module (http://drupal.org/project/feedburner) that helps with feed redirection and also FeedFlare/StandardStats/Ad Network insertion. You might want to check it out.