Wednesday, May 11, 2005

Add RSS autodiscovery to your site (and it's real easy, too)

If you're anything like me, you often will not have the exact RSS address of a website on hand when it comes time to actually subscribe to their feed; in my case, most of the time I'll simply pop the site's main URL into my "add channel" form, and simply hope that Bloglines can figure out the site's RSS address on its own. Well, here's a line of code you can add to the top of your blog's template or HTML page, if you want this autodiscovery to happen every time someone does this:

<link rel='alternate' type='application/rss+xml' title='Your site's name' href='Your RSS address'>

This is also the code that lets Firefox and Safari do their cool RSS-autodiscoveries right from the browser as well. It should be noted, by the way, that many blog-hosting services actually add this code already to your template; you should check out yours first before going to the extra trouble of adding it by hand. (Many thanks to "Blogging Business" for passing along this tip.)