I was reading a post from Performancing in Bloglines today. However, I when I tried to click on a link within the post to another page on Performancing, I got a "404 page not found" error. Why? Because they use root-relative URLs rather than absolute URLs for internal links on their site.
A root-relative URL is one that has all the usual path information in it, except for the site domain at the beginning - i.e. it starts at the root. Here's an example:
/miaow/archives/000216.html
However, in Bloglines this URL reads as:
http://www.bloglines.com/miaow/archives/000216.html
Hence, the 404 error.
It seems like this has been an issue for a while - back in 2003 Brainstorms & Raves wrote:
An exception where absolute URLs are required is within RSS feeds for which absolute URLs are currently still needed.
You'd have thought that this would have been fixed by now; apparently not. It may depend on which format you distribute your feed. I'd love to know more if anyone has additional information.
So, although the conventional wisdom is to use relative URLs for internal links within your site, bloggers may want to consider using absolute URLs to ensure that these links work in their RSS feeds.
Posted on: January 27, 2006 | 8 Comments



8 Comments Posted
I'm not 100% sure about this, but you might be able to get around this problem by using something like:
I know it works for regular (X)HTML web pages, but I'm not sure how it would be treated in an XML feed.
Either way, RSS feed readers should be designed to be smart enough to do this sort of thing automatically for relative URLs. They should know that any relative URL is relative to it's original context and not whatever context the reader is displaying it in.
1. Posted by Richard Davies on January 27, 2006
Whoops! I guess that live comment preview isn't 100% accurate when dealing with HTML code... ;-)
2. Posted by Richard Davies on January 27, 2006
I've started using absolute URLs in all my posts for this reason.
3. Posted by Ben Eastaugh on January 27, 2006
Richard - fixed your code issue (when you put something in <code> tags you don't need to worry about the left bracket being treated as HTML).
Interesting solution - wonder if it would work?! Like you said, though, feed readers should be able to understand this.
Ben - I do too, but only because when I copy and paste links I'm too lazy to strip out the domain part. Lucky for me, I guess!
4. Posted by Christian Watson on January 27, 2006
So is this an issue with rss .92/2.0 only, or Atom as well?
5. Posted by Rob Sanheim on February 06, 2006
Rob - sorry, I've no idea! It's all a bit too technical for a simpleton like me. Try posting something on a forum like Sitepoint if you really want to know.
6. Posted by Christian Watson on February 06, 2006
Just always use absolute Urls. That works.
7. Posted by Troy on February 20, 2006
Troy - that's what I do. Keep it simple, I say!
8. Posted by Christian Watson on February 21, 2006