nixCraft Poll

Topics

Lighttpd: redirect feed traffic to a Feedburner account

Posted by Vivek Gite [Last updated: August 5, 2006]

Lighttpd logo

Reader chadrick asks, "How to redirect feed traffic to a Feedburner account?"

There is a plugin available for Apache and Wordpress, but it will not work with Lighttpd. So if you want to redirect RSS/atom feed from your domain to Feedburner to get accurate feed stats, you need to use Lighttpd's mod_redirect module.

For example request coming for following urls shoud go to your feedburner a/c:
http://domain.com/feed/ => http://feeds.feedburner.com/MyAccount
http://domain.com/index.php?feed=rss => http://feeds.feedburner.com/MyAccount
http://domain.com/?feed=rss => http://feeds.feedburner.com/MyAccount

Open your lighttpd configuration file and tell lighty to redirect all visitors except Feedburner bot or site.

# vi /etc/lighttpd/lighttpd.conf

Find out your virtual domain configuration and append following directives:

$HTTP["useragent"] !~ "FeedBurner" {
url.redirect = (
"^/feed*" => "http://feeds.feedburner.com/MyAccount",
"^/\?feed=*" => "http://feeds.feedburner.com/MyAccount"
)
}

Replace MyAccount (or feedburner url) with your actual feedburner feed url. Save and close the file. Restart the lighttpd webserver:

# /etc/init.d/lighttpd restart

If you are using a Blogger.com hosted blog (your own domain) put something as follows (e.g. http://mydomain.com/blog/atom.xml):

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

Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

You may also be interested in other helpful articles:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.