How to setup Feedburner and drupal5 ??
I'm trying to route my drupal feed via feedburner to give me better stats etc.
I've found various references on drupal.org to how to set this up with drupal 4.6 and 4.7, but it seems that things have changed and the advice no longer applies to drupal 5.
What I have done so far:
1. My feed is set up at http://www.steveparks.co.uk/feed
2. I have provided this feed to feedburner to create http://feeds.feedburner.com/SteveParks
3. I have upgraded to their own domain service, setup a CNAME entry on my DNS as instructed, so now I can have my feedburner feed at http://feeds.steveparks.co.uk/SteveParks
The challenges are:
A. I now need to change the autodiscovery rss feed link in the header of my site to this new URL.
B. I also use commentrss module, and want to remove its autodiscovery feed link in the headers, so that my blog feed is the only autodiscovery link
C. I need to replace all instances of the feed icon, so that they point to this new feed URL.
And does anyone else have any advice about using feedburner with drupal? particularly 5.1?
Thanks very much for any help
Steve

Update
This thread:
http://drupal.org/node/30534#comment-70874
Has a suggestion to fix this at the theme level:
Is this the best solution or is there a way of overriding the original setting in a cleaner way of doing what I was looking for in my original post above?
Thanks
Steve
Keeping control of subscribers using temporary redirects...
Hi Steve
If you change the autodiscovery feed links to point directly to the FeedBurner versions you are basically handing over the keys to FeedBurner. If you later for some reason wish/need to change to either another statistics provider or maybe pure Drupal you will need to get all your subscribers to change the URI they are fetching the feed on.
Another way is to have your subscribers subscribe to the Drupal feed. In other words the URI pointing at your site. In order to still use the FeedBurner version of the feed you then need to temporarily redirect (HTTP code 302) the Drupal URI to the FeedBurner URI.
The effect is that an aggregator will try to fetch the feed via the Drupal URI. It then gets a 302 redirect to the FeedBurner URI. Since it is an temporary redirect (302) it will keep the Drupal URI, and then fetch the feed via the FeedBurner URI. A side effect is that you will get a log entry in the server access logs with the code 302, so you will also get information about the feed in your site log based statistics.
Using the paths you mention above add these lines to your .htaccess file above the Drupal rules:
##
## START: FeedBurner redirects
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^feed$ http://feeds.steveparks.co.uk/SteveParks [R=temp,L]
## END: FeedBurner redirects
##
The rules above means:
If the request is for "/feed" and the user agent is not "FeedBurner" then temporarily redirect (the "R=temp" parameter) to "http://feeds.steveparks.co.uk/SteveParks" and stop applying (the "L" parameter) the rules in the .htaccess file.
To stop the redirect and use the Drupal feed you just comment out or remove the rules in the htaccess and the aggregators will instead fetch the feed directly from your site. No resubscription or editing the feed URI needed by the subscribers.
To change the behavior of all the feed icons you will need to overrule the following theme function in your themes template.php file:
theme_feed_icon | Drupal API
http://api.drupal.org/api/5/function/theme_feed_icon
You could basically check the $url supplied to see if it is ok (business as usual) or one that should not be shown (return empty string).
Now Drupal generates a lot of feeds. For instance every taxonomy term page has its own feed. These won't be tracked by FeedBurner unless of cause you create a FeedBurner version of each and every feed and make a redirect for each.
You could ignore this issue or change the autodiscovery link in your template to always point at the main feed (the Drupal URI).
To change the autodiscovery link and/or remove the autodiscovery link to the commentrss feed ... hmm ... that is a bit tricky ... they are set by:
drupal_add_feed | Drupal API
http://api.drupal.org/api/5/function/drupal_add_feed
which calls:
drupal_add_link | Drupal API
http://api.drupal.org/api/5/function/drupal_add_link
Unfortunately there is no theme function to do something similar as with theme_feed_icon above. You will need to change/remove the link from $head (which contains more than just the feed links) in your page.tpl.php (or in template.php before passing control to page.tpl.php, see: Making additional variables available to your templates | drupal.org @ http://drupal.org/node/16383) using some form of string replace using regexp.
I hope this helps :-)
Regards,
Christian Larsen
Thankyou so much
Hi Christian,
Thank-you so much for one of the most comprehensive and helpful replies to a support question I've ever had! You took the time to step through what you were advising and explaining each step to a noob, and I really appreciate that.
Am I right in understanding though, that if I add those lines to the .htaccess file, I don't need to change the autodiscovery links or button links for /feed?
Thanks again for being so helpful.
Steve
Thank you for your praise :-)
Hi Steve,
You are right on the nose :-) ... no need to change the autodiscovery links or feed icons for the main feed at http://www.steveparks.co.uk/feed with the two lines in place in your .htaccess file.
You may need to make some changes for all the other feeds depending on how you want to advertise your content.
If you only want the main feed a quick solution would be to add one extra line to the .htaccess file which match on "^.+/feed$" (that is http://www.steveparks.co.uk/something/feed) and then does a permanent redirect (HTTP code 301) to "^feed$" (which is http://www.steveparks.co.uk/feed).
The 301 tells the aggregators that the URI for the feed has changed and that the new one should be used from now on. It then goes for the main feed and gets a temporary redirect to FeedBurner...
I have not tried this so the following code is untested:
##
## START: FeedBurner redirects
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^feed$ http://feeds.steveparks.co.uk/SteveParks [R=temp,L]
RewriteRule ^.+/feed$ feed [R=permanent,L]
## END: FeedBurner redirects
##
Well this is only a quick fix though if your feeds are already indexed by Google, MSN, etc. you should make a permanent redirect for the ones you remove. This way you will transfer the (in Google speak) PageRank to the target page/feed of the redirect.
The proper way is of cause not to link to the feeds in the first place and as you write you want to remove the commentrss feed from autodiscovery so some hacking in your theme is necessary. A string replace with a little regexp should do the trick for that one.
Happy hacking :-)
Regards,
Christian Larsen
Getting there!
Hi Christian
With your help I'm slowly getting there.
I've actually disabled the commentrss for now, just to simplify things. I've themed the feed icon so it always shows my main feed link, and I've setup the htaccess redirects you recommended.
The only problems that remain now are:
1. There are still unwanted autodiscover links on the example.com/blog and example.com/blog/1 pages - which are in the breadcrumbs to each blog post.
They, for example show:
Your latest htaccess redirect will correct these if anyone subscribes to them, but I'd rather have the correct one there on the first place. How do I achieve this please?
2. And the posts themselves, when viewed as the full page, don't have an autodiscovery link. Is there a way to add one to every page on the site as a default with the same main feed?
Thanks very much for your help.
Steve
Amazing
Hey Christian,
Thanks so much for the write-up! It was the most concise and easy-to-follow one yet on this subject.
I have a question about it... I've noticed that this works fine redirecting individuals; however, it does not seem to redirect Google Reader. (When I subscribe in Google Reader, it still uses the "feed" path as opposed to the feedburner path).
Of course, I'd like to have google use the feedburner path so that (given the new reporting stats interface), my google reader users are included in the feedburner statistics.
Do you have any insights?
~Travis
New Feedburner Module
http://drupal.org/project/feedburner