Read my latest article: Lessons in Open Source (posted Mon, 27 Jun 2016 17:04: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" => "",  
    "/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 01: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 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