So here’s a fun story about some wasted time. I configured feedburner a while back to use as the RSS Feed for the site.
I like the way Feedburner looks compared to the default RSS Feed. The social icons are better, you can get better statistics out of the system. Plus, it’s owned by Google. Never hurts to supply Google with as many links to your site as possible (don’t quote me on that, I really doubt it actually matters).
A lot of times, I like to be a log junkie. I sit back and hunt through my site logs on occasion. I like to look for errors with the site, and fix them before they cause to many issues. Sometimes I even find malicious bots trolling the site and I can block them or deal with them at least.
Anyway, I noticed that there were several attempts to hit the WordPress RSS feed that is the default. The systems ( a Google Gadget, something from Yahoo, etc. ) were hitting the site on a regular basis. It’s not that they were getting old information, but it was quite a few subscribers that weren’t getting the legitimate feed, and thus I wouldn’t see the proper tracking.
I started scouring the Google Search for a method to redirect the feed via a redirect in the htaccess file. I didn’t want to use a plugin and create additional overhead when it can be done so easily with the htaccess. And I didn’t want to spend the time to write it myself, when I’m sure it was out there several times over.
I found a code block from Perishable Press:
# 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/wordpress-master/feed [R=302,NC,L]
Naturally if you are going to use this code make sure you change out my feedburner address for your own.
The problem was that after I added it to my htaccess it didn’t work. I just popped it in really quickly, wasn’t paying attention at all.
After spending a lot more time than I wanted to spend on it, researching alternatives online. I finally started reading comments. There are several posts out there that all use this code, but none solved my problem.
Reading the comments, someone mentioned that the code has to be before the permalink rewrites that WordPress uses. Doh, I’m an idiot. If I would have just spent two seconds to actually look at the code I would have realized it. But instead I tried to save time and just do it quickly.
I guess in this case trying to NOT “reinvent the wheel” I cost myself a lot of unnecessary time. Especially on something this simple that I could have just written myself. Oh well, live and learn.
Related posts:
{ 4 comments… read them below or add one }
Hmm… I read blogs on a similar topic, but i never visited your blog. I added it to favorites and i’ll be your constant reader.
I was having the same problem and you save me! ) Thanks
Excellent, Glad to help.
good stuff. Do you have a RSS feed? And will it be cool if I put in your feed to a website of mine? I have a website which draws content through RSS feeds by a number of sites and I would like to include yours, many people really don’t mind given that I link back and everything but I like to get approval 1st. Anyway let me know if you can, thank you.
{ 1 trackback }