Redirect Feed Links to using .htaccess

Feedburner used to a powerful tool for RSS feeds publishing and subscriber management. However, feedburner will unlikely leave its maintenance mode because there has been no new features yet less features for quite some years. But RSS feed is still an important part of the Web supported by many software such as WordPress. is one of the good alternatives for managing the RSS feeds.

The post How to Redirect WordPress Feed to Feedburner Using .htaccess introduces how to redirect WordPress RSS feed to feedburner using the powerful .htaccess. Let’s look at how to use .htaccess to redirect feed URLs to in this post. The method is based on .htaccess so it is content management software neutral and many software like WordPress can be supported.

Let’s use <site domain>/feed?.* (? means one character (like /) and .* means any string) as an example as the original URL. Now we redirect it to URL .

The idea is: for every request to the URL, first check whether the HTTP_USER_AGENT is from by matching the HTTP_USER_AGENT string. If HTTP_USER_AGENT matches the keyword, do nothing so that the feed content will be returned to the requester. Otherwise, redirect the request to the URL since it is from a normal users’ browsers or some feed readers. Through this method, the normal user can read the feeds from, while can get the original feeds content from the website.

The method
Add these codes to the beginning of the .htaccess file in the directory of the site directory / (because /feed is under /; use different directory according to the site software and path structure):

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_URI}      ^/feed        [NC]
 RewriteCond %{HTTP_USER_AGENT} !^.*(          [NC]
 RewriteRule ^feed?.*$  [L,NC,R=302]

Then you may test it using and using your own browser to verify that different agents get different content.

Leave a Reply

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