Ampersands in rel=”canonical”

I’m using this as a workspace to provide an example for an SEO question for @dancristo, but by all means jump in here if you know the answer to this.

I’m trying to determine if there’s a difference between the following two rel=”canonical” entries:

<link rel="canonical" href="http://www.example.com/this&that" />

<link rel="canonical" href="http://www.example.com/this&amp;that" />

The first URL is what shows up in the address bar, but the second version is the output from a server-side control (.NET) that populates the canonical tag.
What do you think? Do search engines see these as the same?

Other Posts You Might Like

  • http://twitter.com/dancristo dancristo

    Hey Jim,
    When you have a URL that contains an &, and you want to write that as a link in your source code you should use the & structure. So the canonical tag should look like . That is the valid way of dealing with an & in URLs within HTML. Search engines understand this well.

    Now when you’re writing a URL in the browser, you want to use the & version only.

    Search engines make the conversion and see them as the same URL.

    Here is some detailed information as to why this is:
    http://htmlhelp.com/tools/validator/problems.html#amp

    I hope that helps.
    Best,
    Dan Cristo

    btw. I’m starting up a new SEO question/answer site in a few days. I’ll let you know of the link as soon as it’s up. I hope you’ll drop by.

  • http://whirledview.com Jim Robinson

    This is great information, Dan. Thank you!

    If I’m following what you’re saying, I think it’s likely that Disqus has stripped some of the characters from “& a m p ;” in what you wrote above. It’s clear, however, from the canonical link how it’s supposed to be formatted.

    I’ll be sure to check out your new site once it’s up. Feel free to come back and drop your link here.

  • http://twitter.com/dancristo dancristo

    Hey Jim,
    Thanks for pointing out that disqus stripped out a bit of the answer. I went in and added some additional spaces for clarity. Seems to read better now.

    I’ll let you know when the new site is up. I love Q/A like this, so I’m very excited to to be interacting with other SEO minded people like yourself.

  • http://twitter.com/dancristo dancristo

    Hey Jim,
    Just wanted to drop by to let you and the WhirledView community know about my new SEO Q&A site: http://SEOcampfire.com. I hope you don’t mind that I reposted your question and the answer over there as well.

    Let me know what you guys think.
    Best,
    Dan

blog comments powered by Disqus