Welcome to DavidMeade.com!

...some terribly witty thing here.
New Google proof Quoteboard!
 ::   ::   ::  [Log in]
Wednesday Apr 16th 2008

Publisher Friendly Feed URLs

 
This post filed under: Blog, Geekery

Bloggers, podcasters, and videobloggers often live and die by their syndication feeds. Syndication feeds such as RSS feeds are just URLs where the recently posted entries/episodes are listed. “Subscribers” enter these URLs into applications like Google Reader, Bloglines, or iTunes in order to get all the latest and greatest content out there without having to actually browse to scores of websites and download each manually.

So, its a good idea for publishers to make sure their Syndication Feed URL is easy to find on their website.

Sometimes a publisher gets lucky enough to have more than himself and his best friend as a subscriber, and watches with glee as he gets more and more and more subscribers over time.

But what happens if the publisher wants to start using a different blogging software, or changes some 3rd party services, or perhaps even just starts using a different set of core-plug-ins and in doing so ends up changing his syndication feed URLs? Does he lose all of those original subscribers? Do all of his original subscribers have to unsubscribe from the old URL and then resubscribe to the new one?

Thankfully, no. With a little planning the publisher can make sure he never has to lose or inconvenience a subscriber just because his source syndication feed URL has changed.

I was recently asked how a publisher might move subscribers from one subscription feed to another without actually asking them to unsubscribe from one URL and then resubscribe at another. The following are my tips on how to set up “publisher friendly” feed URLs. By “publisher friendly” I mean the publisher is now free to do whatever he wants with his blogging software or source feed …. secure in the knowledge he wont lose or inconvenience his subscribers.

This post is a bit long and may be a bit scary, but don’t worry … there are only six steps. I’ve tried to include alot of explanation behind the steps so that you can really understand what is happening, but don’t let the added words here scare you away …. it’s pretty simple.


Goals:

  1. Give your subscribers a feed URL that never changes - no matter what you do on the back-end of your site.
  2. Move any existing subscribers over to this “permanent” URL, transparently - no inconvenience to your subscribers.

To accomplish the first goal you have two choices.

  1. Use a service like feedburner and just publish the feedburner URL.
  2. Create a URL at your own domain such as http://mydomain.com/feed

Option 1 is easier because it doesn’t require that you have the ability to edit your .htaccess file, but it does require you always use feedburner. (i.e. you can’t later switch services without having to readdress this issue again) …. So if you have the ability to edit your .htaccess file, option 2 is ideal. Lets assume you want to use option 2.


Prep work:

Step 1) Find your BLOG-GENERATED FEED URL.

Step 2) Decide if you want to use feedburner (or similar service), and if so use the BLOG-GENERATED FEED URL when creating the FEEDBURNER URL.

NOTE: From now on, when I mention “SOURCE FEED” I mean either a) the FEEDBURNER URL (if you are using feedburner or a similar service) or b) your BLOG-GENERATED FEED URL (if you aren’t using Feedburner or a similar service).

So with that in mind, lets assume for the sake of these instructions that your SOURCE FEED is http://feeds.feedburner.com/MYSOURCEFEED (Be sure to replace this URL with your actual SOURCE FEED URL in any of the instructions below)

Step 3) Now lets pick the FEED URL that you will actually publish to your visitors/subscribers. Pick a URL at your own domain that doesn’t already exist. This is the URL you will publish as your FEED URL, and its only purpose is to redirect (behind the scenes) subscribers to the SOURCE FEED where all the data actually is. Lets assume the FEED URL you chose is http://www.mydomain.com/feed. (It’s the /feed portion that we want our server to redirect to the SOURCE FEED, and we’ll use that portion in our examples/code below.)

(Has Step 3 confused you? Check out this clarification of Step 3)

Goal #1: Give your subscribers a feed URL that never changes.

Step 4) Now all you have to do in order to accomplish Goal #1 is redirect your FEED URL to your SOURCE FEED. The advantage to doing this is that if the location of your SOURCE FEED ever changes, you can just update the redirect, and your subscribers are none-the-wiser. To accomplish the redirect, you’ll need to edit the .htaccess file for your website. (If you’re having problems finding the .htaccess file, try a different FTP / File manager program - the .htaccess may be ‘invisible’ in the listing your application provides)

Add the following lines to your .htaccess file (above any other redirect rules or <IfModule> blocks that are already in the file):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^feed/?$ http://feeds.feedburner.com/MYSOURCEFEED [QSA,L]
</IfModule>

Goal #1 is now accomplished!

That was easy wasn’t it!? You can now send any new subscribers to your newly created FEED URL (http://www.mydomain.com/feed) and they will actually be subscribing to your SOURCE FEED (http://feeds.feedburner.com/MYSOURCEFEED). As described before, you can alter the redirect at anytime in the future should your SOURCE FEED URL change … and your subscribers will automatically move with you. Nice.

Goal #2: Moving existing subscribers from an old feed URL to the new one you just set up.

Step 5) First things first, determine what your OLD FEED URL is. Lets suppose it was something like http://mydomain.com/archives/feed.xml. Notice it’s the “archives/feed.xml” part of the OLD FEED URL that defines the file we want to redirect … so lets call this last part the OLD FEED PATH. We’ll only need to reference the OLD FEED PATH (archives/feed.xml) in the .htaccess rule we’re about to write.

Step 6) Now, lets provide a redirect for your OLD FEED to your new FEED URL. We do this just like we did with the last redirect we wrote - by modifying the .htaccess file.

We’re going to use a slightly modified rewrite rule this time however because we want this redirect to report a “permanent” redirect so that smart feed readers will automatically move over to the new url from now on (don’t worry the dumb feed readers will just keep asking for the old one and just keep getting redirected to the new one each time).

To accomplish this redirect, add the following line to the code you just added to the .htaccess file - just above the </IfModule> line.

RewriteRule ^archives/feed.xml$ /feed [R=301,L]

Done and Done! Goals 1 and 2 have now been accomplished.

The overall changes to your .htaccess file should look like this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^feed/?$ http://feeds.feedburner.com/MYSOURCEFEED [QSA,L]
RewriteRule ^archives/feed.xml$ /feed [R=301,L]
</IfModule>

And you’ll want to put these lines above any other rewrite rules or <IfModule> blocks you already have in the .htaccess file.


So what have we accomplished?

  • Your old/existing subscribers will be seamlessly redirected to your new FEED URL (http://mydomain.com/feed) the next time they request the OLD FEED URL (http://mydomain.com/archives/feed.xml)
  • New subscribers will start off requesting your new FEED URL (http://mydomain.com/feed)
  • So, now ALL of them are asking for your new FEED URL (http://mydomain.com/feed) … which is redirected to your SOURCE FEED

Now, you can change just about anything you like. You can change the source of feedburner, or even drop feedburner all together in the future and your subscribers never have to change their FEED URL. You just simply alter the redirection in your .htaccess file to what you want - and your users wont know the difference.

As an added bonus, you’ve just cheaply and easily ‘branded’ your feed URL with your domain name (instead of feedburners).

Extra Credit:
For extra credit you may want to update your blogs theme or styles to publish your new FEED URL both in the content of your pages as well as in the auto-discovery links in the page headers.

13 comments

Thanks David, this really rocks. I’ll be trying it out when I redesign this summer, and possibly begging for your help if I screw up. But your instructions are clear and look easy to follow. Cool!

And, I just linked here from http://showinabox.tv !! This post has been added to the What’s New and Tutorials sections.

Nice, thanks for the plug, Cheryl. :)

I hope the info can be of use, and of course do feel free to shout at me if you need help.

Hi Dave -

There is no .htaccess file on the server, so I tried creating one and following your instructions, but it’s invisible and not having any effect..

Any ideas?

got it working :)

thanks again!

Excellent, glad you got it working, Will!

The .htaccess file will indeed be invisible in most listings, so you’ll need to use an FTP program or some file manager that allows you to see/edit invisible files.

Once again I am in awe of THE David Meade……I may have to pick your brain some more on this….Hmmm

hehe feel free.

I see you got gravatar working, Heath, awesome! I love the gravatar you’ve selected. :-)

Yes David - that’s what got me - Transmit didn’t make it easy to see invisible files - Filezilla on the other hand, did.

David, thanks for the instructions. The 3rd step is confusing me however. I’ll put my words in after yours:

“Step 3) Now lets pick the FEED URL that you will actually publish to your visitors/subscribers. Pick a URL at your own domain that doesn’t already exist. ”

In this line you suggest that I “pick the FEED URL” and they you say “Pick a URL at your own domain that doesn’t already exist.”

Where does one “pick” a URL that doesn’t exist? Does this mean that I should “Create” a URL? And if I create it - what should it say - and where would I create it?

“….Lets assume the FEED URL you chose is http://www.mydomain.com/feed.”

Again, you ask me to “chose” a URL - I’m still lost. What’s the process for choosing a URL?

I appreciate it. I think I can find the feedburner URL, and I suspect that I’ll be able to find the htaccess file somewhere, but “finding” and “choosing” this URL is a bit more complicated.

Thanks again,
Milt Lee

Dear David,

Thank you for this information, it seems like a very good idea as I am about to launch my video podcast. Hopefully if I do this up front it will help avert problems in the future.

However, I have to agree with Milt, step 3 confuses me.

As you know, it says to “pick the FEED URL that you will actually publish to your visitors/subscribers. Pick a URL at your own domain that doesn’t already exist.”

How, exactly, does one “pick a URL?” I am using the self-hosted version of WordPress.

Thanks in advance for your help!

Sincerely,
Rosa Linda
http://www.NewMexicast.com

@Milt & @Rosa:

Sorry for the delay in response. For step 3:

By “pick a url that doesn’t already exist” I simply mean that you can literally make it up. Just dream it up in your head - anything - whatever URL (at your domain) you would want to use for your feed URL … this is the one you should choose. (The only rule here is that this made up URL cannot be one that already points to a real page at your site.)

Pretend for a minute that there were no rules … what would you want your feed url to be? If in your perfect world, you would want your feed url to be http://mydomain.com/feed then this is the Feed URL you should pick.

Now let me give you an example of picking a URL that might not work: Lets say the url you dreamed up out of nowhere was http://mydomain.com/about …. it’s fine url, you think. But, if this URL already points to an ‘about page’ on your site … you can’t use it for your feed too. since it already exists and is pointing to something else you cannot use it for your feed.

So pick any url - just make it up - that doesn’t already exist (that doesn’t already point to something) - and we’ll use this as your new Feed URL.

Does that make more sense?

I appreciate the help in making these instructions more clear.

Dear David,

Thank you, thank you, thank you! I am going to try it right now. It’s so funny how sometimes my mind makes things so much more complicated than they need to be.

Also, I started a thread on the Show-In-a-Box forums about this, so if you don’t mind, I am going to paste your answer there too, in case anyone is listening in.

Sincerely,
Rosa Linda

I really like this? All bloggers should take note of this and do it - excellent for flexibility, usefulness, and SEO.


You came all this way, why not leave your own comment?!
 

Leave a comment:

OR