We all know that Google Feedburner is a great tool for Feeds. Many of you have already opened account in Feedburner and added your feeds. I have seen lots of WordPress site using the link of feedburner but when I manually type in their default feed address. It just shows the WordPress feed. That means you have created the feebburner feed but haven’t use redirection.
There are two ways to redirect the feed to Feedburner:
- One is through the WordPress action hook
- Second is by editing your .htaccess file
Now let’s look at this two options and learn how to do it:
- Redirect WordPress Feeds To FeedBurner using Action Hook: I feel this method as the safe and best way to do feed redirect compared to editing .htaccess file. We have also use the same one, if you try to go to
http://catchinternet.com/feed, you will be redirected to FeedBurner’s feeds for Catch Internet. First open your funtion.php file which is located in your theme directory. You can simply add the following snippet in function.php to redirect your WordPress Feed to Feedburner.//Redirect WordPress Feeds To FeedBurner add_action('template_redirect', 'ci_rss_redirect'); function ci_rss_redirect() { if ( is_feed() && !preg_match('/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'])){ header('Location: http://feeds.feedburner.com/catchinternet'); header('HTTP/1.1 302 Temporary Redirect'); } }In the above code you just need to replace
http://feeds.feedburner.com/catchinternetwith the FeedBurner URL. - Redirect WordPress Feeds to Feedburner using .htaccess file: First open your .htaccess file which is located in your root directory (Hint: same folder where wp-config.php is located). You can simply add the following code to redirect your WordPress Feed 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/catchinternet [R=302,NC,L] </IfModule>In the above code you just need to replace
http://feeds.feedburner.com/catchinternetwith the FeedBurner URL.

