Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

How should I use canonical tags when I have multiple variables?

         

buguela

1:35 pm on Feb 18, 2009 (gmt 0)

10+ Year Member



Hello,
I want to know if someone can help me about a correct usage of canonical tags when you have multiple parameters.

Example:

www.site.com/page.php?foo=1&bar=2

Should I use & or & into rel attribute?

1) <link rel="canonical" href="http://www.site.com/page.php?foo=1&bar=2"/>

2) <link rel="canonical" href="http://www.site.com/page.php?foo=1&amp;bar=2"/>

Which is the correct one?

buguela

2:06 pm on Feb 18, 2009 (gmt 0)

10+ Year Member



Pedro Dias, from Google Ireland, told me into Portuguese Webmasters Group that we should use as we use into URL address bar... so, we should use version one.

[google.com...]

tedster

8:28 pm on Feb 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for both the question and the answer. I ran the Portuguese through Google Translate, and indeed, this is what it says:

The links must be placed in the same way that you would put in the address bar of your browser.

That makes sense to me.

phranque

3:52 am on Feb 19, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



except that it won't validate:
Warning: unescaped & or unknown entity "&foo"