Archive for June, 2009

Self reference doesn’t match document location

<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://mysite.com/feed" onclick="javascript:pageTracker._trackPageview('/outbound/article/mysite.com');" type="application/rss+xml" /><item>

If you have ever ran your RSS feed through a feed validator and received the message: “Self reference doesn’t match document location” and have no idea what that means, I may have a few tips for you.

While this is just a recommendation and not an error, it could still cause you problems depending on how you’re using your feed.  I host my RSS feed on my own site, run it through FeedBurner and then distribute the feed to different sites for distribution.  One of those places has been having problems with my feed lately and I’ve had this recommendation showing up after trying to validate it through http://feedvalidator.org.

I didn’t think it was worth worrying about, but I recently fixed it just to make sure it wasn’t causing any problems.  It took me a while to figure it out, but it’s basically a self-referencing link.  If for any reason the URL of your feed does not exactly match this, you’ll get the “recommendation” message.

  • The first thing to check is to make sure that link is the URL people use for your feed.  If you’re doing fancy HTTP or .htaccess redirects, you should be giving people the destination URL, not the one that redirects them to something else.
  • The next thing to check for are spaces in your URL.  Even though some operating systems allow spaces in file names, it’s a general practice to try and avoid them.  Try using dashes or hyphens.
  • The last thing to remember is your links are case-sensitive.  If you’re sending someone to http://mysite.com/feed but your RSS feed references itself as http://mysite.com/Feed, you’re going to get the “error” message when you try to validate your RSS feed.  The hard part can be tracking down where this is set,  depending on how your feed is created and how you’re manipulating it.

I hope these few tips can help you out.  Generally it’s hard to find any help when looking around for an answer to a question like this.