HOWTO use FeedBurner without giving up control
Update on June 1: There’s a new WordPress plugin that makes using FeedBurner a snap. There’s no need to manually edit .htaccess. The plugin takes care of all the redirect rules. I’m using it now and it’s working great. The method described below does work, however, I think the plugin is easier to use and more reliable.
My host uses Apache and mod_rewrite which are prerequisites to making the following method work.
WordPress makes extensive use of rewrite rules in an .htaccess file. You’ll find the .htaccess file in your blog root directory. You can make a few changes to .htaccess which will forward requests for your feeds to FeedBurner. The changes will allow only FeedBurner access to the source feeds. At any time in the future you wish to stop using FeedBurner, like if they go dark, just remove the rewrite rules from .htaccess.
In a default installation of WordPress, you’ll find lines in your .htaccess file that look like this:
RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1 [QSA,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1 [QSA,L]
Move these lines to the very end of .htaccess. Then edit so they look like the following:
RewriteCond %{HTTP_USER_AGENT} FeedBurner
RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1 [QSA,L]
RewriteCond %{HTTP_USER_AGENT} FeedBurner
RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1 [QSA,L]
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ http://feeds.feedburner.com/<em>insertyourfeednamehere</em> [R,L]
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ http://feeds.feedburner.com/<em>insertyourfeednamehere</em> [R,L]
English translation: a request for any one of your site’s main feeds will be redirected to your FeedBurner feed except if the requester is the FeedBurner agent. Please note: replace insertyourfeednamehere with whatever your FeedBurner feed name is.
This has been working well for me. I hope it works well for you, too.
14 Comments