Read my latest article: Six days to complete the Rails hosting survey (posted Thu, 24 Apr 2014 14:36:00 GMT)

FeedBurner and lighttpd redirects

Posted by Tue, 22 Aug 2006 20:28:00 GMT

3 comments Latest by Shane Vitarana Mon, 28 Aug 2006 00:14:42 GMT

I haven’t been using feedburner to track counts of subscribers to my feed. I didn’t want to tell everyone to switch their feed URL… so I found this solution for handling this transition through Lighttpd.

First, make sure you are requiring the mod_redirect module.

server.modules              = ( "mod_rewrite", "mod_fastcgi", "mod_compress", "mod_redirect" )

Then add the following… to your lighty configuration.


$HTTP["useragent"] !~ "FeedBurner" {
  url.redirect = (
    "/xml/rss/feed.xml" => "http://feeds.feedburner.com/RobbyOnRails",  
    "/xml/rss20/feed.xml" => "http://feeds.feedburner.com/RobbyOnRails",
    "/xml/atom/feed.xml" => "http://feeds.feedburner.com/RobbyOnRails" 
  )
}

Works like a charm!

Thanks to Damien Tanner for putting me on the right path.

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
comments powered by Disqus
Comments

Leave a response

  1. Avatar
    Josh Knowles Thu, 24 Aug 2006 01:20:33 GMT

    If you want to ‘DRY’ this up a bit try the following:

    url.redirect = (”/xml/(atom|rss|rss20)/feed.xml” => “http://feeds.feedburner.com/RobbyOnRails”)

  2. Avatar
    Shane Vitarana Sun, 27 Aug 2006 17:43:42 GMT

    Sweet. I like the DRY approach Josh. I wonder if there is something similar for the RedirectPermanent Apache directive.

  3. Avatar
    Shane Vitarana Mon, 28 Aug 2006 00:14:42 GMT