How to: redirect WordPress RSS feeds to feedburner with .htaccess

Which blogger doesn’t use feedburner? Sure, feedburner is a very nice service, allowing you to know how many people suscribed to your rss feeds. The only problem is that you must edit your theme files to manually change the rss url. Happilly, there’s a nice hack, using .htaccess, which will make you save a lot of time!

Perishable Press have a very nice .htaccess hack to redirect your WordPress rss feeds to your feedburner feeds. Each time someone will click on a link to http://www.yourblog.com/feed, he'll be redirected to http://feeds.feedburner.com/yourblog.

Simply edit your .htaccess file, and paste the following. Don't forget to alwyas backup your .htaccess file before editing it!

# temp redirect wordpress content feeds to feedburner
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
 RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
 RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/wprecipes [R=302,NC,L]
</IfModule>

That's all. After saving your .htaccess file, all your rss link will redirected to your feedburner feeds.

66 Responses

Oct 09 2008 14:08

Very nice recipe! But the feedsmith plugin can do the dirty job for you.

Oct 09 2008 16:31

You’re right, but even if you’re using a plugin, it’s alwyas a good thing to know how things are done, I think :)

Dec 07 2008 16:08

For novice users, the FeedSmith plugin accomplishes this task as well.

Dec 10 2008 13:13

Thx for sharing this recipe, i just applied to my feed today.
One important thing is that this code must be before wordpress permalink section, if not, can’t work.

Jan 08 2009 11:50

Thanks for share the code, and thanks to @brtak for his note.

Regards,

Jan 08 2009 14:03

Well, anytime dude :)

Mar 27 2009 04:41

You can always do this too:

Redirect 301 /feed http://feeds2.feedburner.com/Human3rror

Jul 08 2009 12:28

This is what i need to redirect my feed.
Jean, How about FeedBurner FeedSmith plugin? is the plugin compatible with WP 2.8?
Thanks before

Jul 08 2009 13:41

@rismaka: Yes, FeedSmith is compatible with WP 2.8.

Nov 03 2009 04:08

Thanks very much to @brtak for his note. This is the 5th site I’ve visited trying to get the .htaccess to work, most of them use perishable press’ version as an example, but this is the first time I’ve noticed a comment that actually told me why I couldn’t get it to work. It’s a “Doh” moment that I should have known, but still a very key piece of information.

Nov 19 2009 05:11

I’m using Thesis theme and seems like I dont need this hack or any plugin because of its inbuilt feature.. yay!! One less plugin for me.. :)

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required