Home  »  Htaccess  »  Redirecting RSS to Feedburner

by 14 comments

FeedBurner, the best syndication company in the worldPouring over my system and server logs I noticed that my raw WordPress feed was being accessed by some suspicious looking bots and addresses, a few were even scraping entire posts and republishing them illegally. I was a little intrigued because I had installed the recommended WordPress plugin to redirect feeds to feedburner- FeedSmith and obviously it wasn't doing what it claimed to do.. Namely, redirect ALL requests for feeds to the feedburner url..

WordPress Feed Rewrites

Using the AskApache RewriteRules Viewer plugin for WordPress, we see exactly what URI's are able to access the feed scripts on a WordPress Blog, at least using internal rewrites. Some of these are quite accessible by everyone when using the FeedBurner recommended plugin, FeedSmith.

wp-atom.php$ == index.php?feed=atom
wp-rdf.php$ == index.php?feed=rdf
wp-rss.php$ == index.php?feed=rss
wp-rss2.php$ == index.php?feed=rss2
wp-feed.php$ == index.php?feed=feed
(.+?)/(feed|rdf|rss|rss2|atom)/?$ == index.php?category_name=$1&feed=$2
wp-commentsrss2.php$ == index.php?feed=rss2&withcomments=1
feed/(feed|rdf|rss|rss2|atom)/?$ == index.php?&feed=$1
(feed|rdf|rss|rss2|atom)/?$ == index.php?&feed=$1
comments/feed/(feed|rdf|rss|rss2|atom)/?$ == index.php?&feed=$1&withcomments=1
comments/(feed|rdf|rss|rss2|atom)/?$ == index.php?&feed=$1&withcomments=1

htaccess code to redirect feed to feedburner

For a non-htaccess solution FeedBurner recommends the following WordPress Plugin FeedBurner Plugin v2.2

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|wp-atom|wp-feed|wp-rss|wp-rdf|wp-commentsrss)(.+) HTTP/ [NC,OR]
RewriteCond %{QUERY_STRING} ^feed [NC]
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC]
RewriteRule .* [R=307,L]
RewriteRule ^comments/?.*$ [L,R=302]

Using htaccess (preferred)

You need an .htaccess that is created/modified by wordpress via the Permalink/mod-rewrite option. Go to Options>Permalinks in the wordpress administration menu and enable "fancy" urls by adding /%year%/%monthnum%/%day%/%postname%/ at "structure".

blog feed - /feed/feedburner feed -

More info on feedburner forum topic

The following is a short quote from that document

If you've had a feed for any length of time, your readers are using your current feed's URL in their news aggregators How can you painlessly migrate their requests from your old server/feed to your newly burned FeedBurner feed, so all of your syndication traffic takes advantage of our services?

Using Wordpress Plugins

The Ordered List WordPress FeedBurner Plugin or the Flagrant disregard Feedburner Plugin will simplify the process.

Google actually lets you submit your RSS feed as a sitemap in the webmaster tool!


  • Both the feedburner plugin and the instructions below will only work if you already have an .htaccess that is created/modified by wordpress via the Permalink/mod-rewrite option.
  • If you have index.php in your permalink structure you have to use a hack. This hack only forwards part of the RSS feeds. To forward all of your feeds to feedburner use this hack.
  • If you have WordPress installed into a folder other than your root folder, you may encounter errors. If so, try Thatedeguy's Hack for a workaround.

Finding Your Feed URL

There are times when you want to tell someone your site's feed address or URL, or you need it to submit it to search engines and directories, many of which now accept feed URL submissions. There are four possible URLs for each of your feeds. Any of these will work.

Or you can access them like this:

If you are using custom permalinks, you should be able to reach them through this usage:

Alternative .htaccess mod_rewrite fix

I have two feedburner feeds, on for posts and one for comments that I wanted to ensure ALL feed requests of any type would work with - your rewrite list of URLs was very helpful in figuring this out. So I came up with this:

Thanks to Mike Baptiste for contributing this excellent alternative!

# Redirect global post and comment feeds to Feedburner without loading WP
RewriteCond %{REQUEST_URI} ^/(feed|wp-atom|wp-feed|wp-rss|wp-rdf).* [NC,OR]
RewriteCond %{QUERY_STRING} .*feed=.* [NC]

# Ditch if they want a comment feed or a feed limited to posts with comments
RewriteCond %{QUERY_STRING} !.*withcomments=.* [NC]

# Any specification of a post ID we skip since it's post specific
RewriteCond %{QUERY_STRING} !.*p=.* [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator|Recent) [NC]
RewriteRule .* [L,R=307]

# Comment feeds can be called via /comments, wp-commentsrss2, or withcomments=1 to the main feed script
RewriteCond %{REQUEST_URI} ^/(comments/|wp-commentsrss2).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*withcomments=.*$ [NC]

# Calls directly to the feed scripts that include 'withcomments' limit to POSTS with comments
RewriteCond %{REQUEST_URI} !^/(wp-atom|wp-feed|wp-rss|wp-rdf).* [NC]

# Any specification of a post ID we skip since it's post specific
RewriteCond %{QUERY_STRING} !.*p=.* [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator|Recent) [NC]
RewriteRule .* [L,R=307]

I noticed that when I switched over to Feedburner I stopped having all the individual post and comments feeds.... That is now fixed by only switching to Feedburners feed for /feed/* or /comments/*I had this same issue when I migrated my wordpress feeds to feedburner using 302 redirects in mod_rewrite based on the USER_AGENT.The result was I lost all my other comment and individual post feeds..But I just realized that all I had to do was change the htaccess code to only apply feedburner when the REQUEST_URI is either /feed/ or /comments/ Now it all works perfectly!


January 7th, 2008

Comments Welcome

  • eBay Blog

    Your guide to using Feedburner with Wordpress seems to be the best I've seen, but I still have some questions:

    1) Is it required to have following URL structure: /%year%/%monthnum%/%day%/%postname%/
    What if I want to use just /%postname%/ (

    2) What I have to do if I want to use MyBrand feature? (I already created necessary CNAME DNS records and enabled that feature in Feedburner account settings)

  • andy

    i am looking for wordpress "" redirection back to homepage itself. Sorry if this is not relevant.

    I have to do this because the /feed is appear at search engine, instead of the homepage. Hope to do a permanent redirect 301 back to homepage. Which means disable the /feed page.

    I tried editing the .htaccess. Cant get it work.

  • koes

    I've been looking all over for a possible solution to my problem, but can't seem to find one yet. Maybe you could help:

    I used to use http://blogname/wp-rss2.php?tag=abc to get certain posts with the abc tag. I installed WP feedburner plugin, and am wondering if I could do the same thing (filter by tag).

    Any help is greatly appreciated.

  • Aaron D. Campbell

    Is there a way to make feedburner track feeds like this as well: (individual post feeds)?

  • Cindy

    would really appreciate some help.

    Have never had RSS feeds until recent, have used one program - no settings to affect my problem:

    Now if I click RSS on a blog, web automatically goes to google rss "add to reader" webpage.


  • Cindy

    found my answer

    In FFox-Feeds
    click subscribe using
    then pick your application

    otherwise automatically redirects to google "add to my reader" page

  • Tarsem SIngh

    By Default "what type of redirection use wordpress??"

  • pimapen

    Well that was much simpler than I was expecting. Thanks!

  • Numaga

    I'm having this strange problem for months now. I've spend many hours googling and trying to fix it but didn't succeed yet. The post here is my last hope really, so I hope someone could help me out and finally get the RSS feed working again.

    I think the RSS stopped working when I changed servers. I uploaded the site to another server and I think that created the error.

    I tried so many things, I'll make a list:
    # Downloaded fresh WordPress zip, took all files with "rss" in it and uploaded those to my server, overwriting the old ones. Didn't work.

    The sitemap was outdated as well, at the exact same date as the RSS. I thought yay I found the problem - deleted the sitemap, then re-installed it - new sitemap works now - RSS still doesn't work.

    I've read many things (while googling) about the htaccess file but I'm not really a coding and/or php expert so I didn't know what to do with it really.

    I tried installing several plugins that create RSS feeds, rss buttons, feedburners etc. None got the RSS going again. uninstalled those later. Still no RSS.

    Uploaded the site to the old server again to check if the rss worked - well, it didn't....

    To make a long story short: I think something is terribly wrong in the core files that are responsible for the RSS feed. I'm not a coder really, I'm not experienced with adding lines of PHP to the theme etc so I hope somebody can help me in the right direction.

    I hope there is a way to "reset" the complete RSS feed back to normal. Any help would be extremely greatly appreciated because this problem kept me busy for about 20+ hours now and I'm becoming desperate of fixing this :(

    Please help!


  • Tom

    Thanks! I used the very last code submitted by Mike Baptiste. I added it ABOVE the wordpress rules and that did the trick. All of the wordpress pages still work great, but I'm wondering if maybe this will slow down my blog slightly... Thanks!

  • Rahul

    Thanks for posting this article and it has been quite helpful in understanding few of the technicalities .
    However I am having some problems in redirecting multiple rss feeds to feedburner, as the feedburner is unable to show updated data .My .htaccess file looks like

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC]
    RewriteCond %{HTTP_USER_AGENT} .
    Redirect 302 /rss/abc.xml
    Redirect 302 /rss/def.xml
    Redirect 302 /rss/ghi.xml

    The first redirect 302 is showing updated data and the rest are showing old data. It would be of great help if you could guide me on this.

    Thanks in advance

  • Pingback: WordPress фиды | С миру по нитке

  • Visual

    Hi, I am have a website that imports the rss through a widget. I want to include images in the import of info. Currently I only receive text, title, time and date in the rss. What do I need to do to get the images to appear. I use wordpress.

  • Thiago Miro

    If I redirect the feed to Feedburner, when the Feedburner request feed won't Wordpress enter into a eternal looping?

    Sorry if I asked something simple and the answer is obvious....

Related Articles

My Online Tools
Popular Articles

Hacking and Hackers

The use of "hacker" to mean "security breaker" is a confusion on the part of the mass media. We hackers refuse to recognize that meaning, and continue using the word to mean someone who loves to program, someone who enjoys playful cleverness, or the combination of the two. See my article, On Hacking.
-- Richard M. Stallman


It's very simple - you read the protocol and write the code. -Bill Joy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

+Askapache | askapache

Site Map | Contact Webmaster | License and Disclaimer | Terms of Service

↑ TOPMain