Lighttpd: redirect feed traffic to a Feedburner account

Lighttpd logo

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

ADVERTISEMENTS

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”
)
}

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
0 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.