Canonical url for a home page and trailing slashes
- by serg
My home page could be potentially linked as:
http://example.com
http://example.com/
http://example.com/?ref=1
http://example.com/index.html
http://example.com/index.html?ref=2
(the same page is served for all those urls)
I am thinking about defining a canonical url to make sure google doesn't consider those urls to be different pages:
<link rel="canonical" href="/" /> (relative)
<link rel="canonical" href="http://example.com/" /> (trailing slash)
<link rel="canonical" href="http://example.com" /> (no trailing slash)
Which one should be used? I would just slap / but messing with canonical seems like a scary business so I wanted double check first.
Is it a good idea at all for defining a canonical url for a home page?