Journal
Feedburner and Textpattern
7 December 2005 › 11 comments
Update: You should point Feedburner to your /?atom=1& URL and not /?rss=1&, because the default RSS version 0.92 that Textpattern outputs gives an insufficient amount of data to Feedburner, namely the date and time articles are posted. Then, just go to Optimize › Smart Feed and and activate it. This will pare down the feed to whatever version of RSS your reader likes, without sacrificing the robustness of Atom for those who prefer it.
If you are reading this article via a news aggregator, then my .htaccess tomfoolery worked, and I have seamlessly transitioned to Feedburner for my RSS feeds. There is no need to adjust your TV set folks, everything went smoothly, according to plan. Assuming you use Textpattern, you might want to know how I did this. I will explain, and also share with you a few tricks to help you when initially configuring Feedburner. I must credit Josh Dura and Lisa McMillan for initially writing about their own experiences using TXP with Feedburner.
The “Who Cares?” Factor
First off, why would you want to process your RSS through Feedburner when it works perfectly well stemming from your own site? Is that not just adding another step of removal from your site, adding delay and further confusion? Good question, that’s one I asked myself for quite some time. Here are a few of the benefits of “burning” your feed with Feedburner:
- More User Friendly
- Tracking Your Stats
- Multiple Feed Versions
Now, rather than seeing funky XML syntax when clicking on an RSS feed link, users will be taken to a page where they can read your aggregated news in an easily understandable fashion. This page also gives the user a brief crash course in what RSS actually is, and provides them with suggestions of possible RSS readers to use.
Feedburner also allows for stat tracking, and outputting of the cheezy little buttons you see on so many people’s sites, proudly displaying their number of subscribers. Besides that, there is an administrative interface showing a graphical breakdown of how many readers use each service. Prior to using Feedburner, I had no idea so many types of RSS services existed!
Yet another benefit of Feedburner is the ability to change your site’s feed into the type that your end-user prefers. For instance, Textpattern outputs RSS version 0.92, but some readers are picky and want to read RSS 2.0. With Feedburner, that’s no problem. It takes what your site outputs by default, and adds in the necessary tweaks on the fly to accomodate your picky readers.
Getting Started
First thing to do is go over to Feedburner and have them “burn” your feed. This is actually a good thing, don’t worry. When specifying an address, put in http://example.com/?atom=1&, with your own domain of course. Take note of that trailing ampersand &, because it’s important.
The reason being, we’re going to redirect your old /?atom=1 address, so we don’t want to have Feedburner pull from there, because it will create an infinite loop, continually redirecting back to itself. The ampersand is the seperator between areas of your Atom feed, so ending it with that symbol, and then not specifying anywhere makes it your default, site-wide feed.
The Code
If you’ve poked around in Textpattern’s default .htaccess file, the following lines of code probably look familiar to you:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
This code handles creating clean URL schemes as the article you’re reading now. If you’re on my site now, you will notice that the in your address bar, you see the address /journal/feedburner-and-textpattern rather than /?id=173. This makes it easy to remember article addresses, as well as keeps your site search-engine friendly.
We want to continue to utilize this schema, and so we will add some of our own code between the <Ifmodule> tags. Just before the closing tag add these lines of code, yourfeed being replaced by your actual feed name of course:
RewriteCond %{QUERY_STRING} ^rss=1$
RewriteRule ^(.*)$ http://feeds.feedburner.com/yourfeed
RewriteCond %{QUERY_STRING} ^atom=1$
RewriteRule ^(.*)$ http://feeds.feedburner.com/yourfeed [R,L]
After the closing </Ifmodule> tag, you will want to add these three lines:
Redirect /rss http://feeds.feedburner.com/sonspring
Redirect /atom http://feeds.feedburner.com/sonspring
Options -Indexes
The first two lines make sure the clean URL feeds are also redirected, if you’re using /rss for example. The last line make it so that people cannot browse to your /images/ directory, among other things. It will go to a directory only if an index page exists, otherwise it will go to Textpattern’s 404 error page. This is a good idea if you don’t want people ripping off your site as easily.
Now we put all that code together, and it should look something like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
RewriteCond %{QUERY_STRING} ^rss=1$
RewriteRule ^(.*)$ http://feeds.feedburner.com/yourfeed
RewriteCond %{QUERY_STRING} ^atom=1$
RewriteRule ^(.*)$ http://feeds.feedburner.com/yourfeed [R,L]
</IfModule>
Redirect /rss http://feeds.feedburner.com/yourfeed
Redirect /atom http://feeds.feedburner.com/yourfeed
Options -Indexes
That’s it, you’re done! Now you can just sit back and relax, knowing that you’ve just made your RSS feed a whole lot more accessible and user friendly. You’ve also become an evangelist, because your feed no longer looks like gibberish, but instead educates the masses about RSS. Also, you’ve gained a way to check exactly how many people are subscribed to your site.
Discussion + Dissension
Comments closed after 2 weeks.



#1 Yannick
Thanks Nathan. I must admit I was hesitant and could not really see the benefits of using Feedburner initially. But who knows maybe I’ll give it a shot at some point. At least I’ll have this article as a reference. ;-)
#2 Nathan Smith
Yeah, I know there are plenty of tutorials out there, I just figured this might help people using TXP not create logic loops that break their feeds. I just checked, and it seems to be working just fine via Bloglines.
#3 Thame
Yup. The one thing that bothers me about TXP is the default feeds. Especially because it prompts Firefox (and a few other browsers) to download it whenever it’s clicked.
I’ve been with Feedburner since September and have had absolutely no problems other than setting it up (and I wouldn’t have if you would’ve written this three months ago :D )
#4 Robert
Cool! Thanks Nathan. I got it running smoothly on my site as well.
#5 Yannick
Sorry to do this Nathan, but I was just thinking about this today.
/begin rant
Umm..no offense to either the TXP crew or other developers out there (you guys are doing a great job and I really mean that), but isn’t it about time they make things that work right off the bat with TXP? (Yes I know some do, but there are others that still don’t.) You’d think TXP would be popular enough by now. Feedburner, Measure Map and Flock’s blogging thingy all require a little extra work to get setup with TXP. Is it a case of TXP being difficult to get their various apps to work with or what?
/end rant
#6 Nathan Smith
Yannick: I would say that’s not a fault of Textpattern itself. That’s just an issue of WordPress having been around longer, and so more people are developing complimentary programs to work alongside it. I can’t say I blame them, because they’re just trying to cater to as wide an audience as possible. I wouldn’t worry, as TXP continues to gain popularity, others will take notice.
#7 Yannick
Okay thanks.
#8 TheUsability
I currently point my feed to
http://www.example.com/content/?rss=1&limit=20
Would the rewrite rule then look like this?
RewriteCond %{QUERY_STRING} ^rss=1&limit=20$
RewriteRule ^(.)$ http://feeds.feedburner.com/yourfeed
RewriteCond %{QUERY_STRING} ^atom=1$
RewriteRule ^(.)$ http://feeds.feedburner.com/yourfeed [R,L]
I’m especially worried about the &...
Cheers,
_TU
#9 TheUsability
Great, it just made the stars into Textile… But you guys know what I mean.
Cheers,
_TU
#10 Justin Perkins
Thanks for this Nathan, really helped me out!
I’ve never seen that method of doing redirects before (not a RewriteRule), interesting. I’ve been using this one and it seems good so far (above the txp rewrite rules)...
RewriteRule ^(atom|rss)/?(.*)$ http://feeds.feedburner.com/JustinPerkins [R=301,L]
(I really like what you’ve done with txp too, especially the comment form)
#11 Nathan Smith
Justin: Cool, I hadn’t seen it done the way you’re handling it. It’s good to know there are other options, in case my method doesn’t work on particular servers. Thanks, by the way, for the compliment about my comment form.