Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

FeedBurner and lighttpd redirects

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

3 comments Latest by Shane Vitarana Sun, 27 Aug 2006 23: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" => "",  
    "/xml/rss20/feed.xml" => "",
    "/xml/atom/feed.xml" => "" 

Works like a charm!

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

Get help with your Rails project

comments powered by Disqus

Leave a response

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

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

    url.redirect = (”/xml/(atom|rss|rss20)/feed.xml” => “”)

  2. Avatar
    Shane Vitarana Sun, 27 Aug 2006 16: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 Sun, 27 Aug 2006 23:14:42 GMT