Redirecting WordPress Feeds to FeedBurner Feeds

wp-rss

The problem. Beginner bloggers usually start to use FeedBurner only after they have seen it used on many other blogs and realize how useful and cool this tool is. They sign up and start to use it, but their early readers are already subscribed to their default WordPress feed.

Another problem: do you often change your theme? If so, you must be bored having to edit each call to bloginfo(’rss2_url’) and replace it with your FeedBurner feed’s URL.

The solution. The solution to both problems described above is simple: use server redirections.

  1. Create a backup of your .htaccess file, located in the root of your Web server.
  2. Edit the .htaccess file and add the following code. Don’t forget to modify the feed’s URL with your own feed’s URL.
  3. # temp redirect wordpress content feeds to feedburner
    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
    RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
    RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/MohamedZaian [R=302,NC,L]
  4. Save the file. You’re done!

Code explanation. Each time someone clicks on a link to http://www.yourblog.com/feed, he or she will be redirected to http://feeds.feedburner.com/yourblog. This way, you will have never lost an RSS subscriber, and even if you change your theme twice a day, you’ll never have to manually edit your RSS feed links again.

Source :- http://www.smashingmagazine.com/2008/12/02/10-useful-rss-hacks-for-wordpress/

This entry was posted in Technical Stuff and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply