SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    A question about the link tag

    I learned this new trick from a Google blog, and it's designed to help people like me, that have duplicate content on my site due to referral URLs. Here is my question...it is ok for me to have two <link> tags in my <header> ?

    Thanks


    <link href="http://www.oil-testimonials.com/styleSheet.css" rel="stylesheet" type="text/css">

    <link rel="canonical" href="http://www.oil-testimonials.com" />
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes you can.

    Quote Originally Posted by Sitepoint HTML Reference
    The link may only appear in the head, but there’s no limit to the number of individual link elements that you can include (a quick look at the source code of any blog powered by WordPress reveals a whole raft of auto-generated link elements relating to archives).
    http://reference.sitepoint.com/html/link

  3. #3
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Code HTML4Strict:
    <link href="http://www.oil-testimonials.com/styleSheet.css" rel="stylesheet" type="text/css">
     
    <link rel="canonical" href="http://www.oil-testimonials.com" />

    Whats the advantage of these code? Pls explain me...

    I saw your reference url...everythink is ok.....but i did not understand this line(<link rel="canonical" href="http://www.oil-testimonials.com" />)
    Cheers,
    Dinesh

  4. #4
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ajaxdinesh View Post
    Whats the advantage of these code? Pls explain me...

    I saw your reference url...everythink is ok.....but i did not understand this line(<link rel="canonical" href="http://www.oil-testimonials.com" />)
    http://googlewebmastercentral.blogsp...canonical.html

  5. #5
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, Google's "canonical" link tag is a waste of space and time. All that happens is the work THEY are supposed to be doing gets offloaded to the site owner. Create a good Web site with unique content on each page, without it being duplicated and you're good to go. (And if you're using a CMS like WordPress, learn how to block those duplicate pages before launching the site.)

  6. #6
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if u define the canonical link in the website to only avoid the duplicate pages.

    its correct?

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

    Duplicate urls
    http://example.com
    http://www.example.com/index.html

    whoever to visit these duplicate urls
    http://example.com
    http://www.example.com/index.html

    google consider this one http://www.example.com

    So google analytic to generate the report in the top content section

    For Example

    Visit no 1 - http://example.com
    Visit no 2 - http://example.com/index.htm
    Visit no 3 - http://www.example.com

    URL
    http://www.example.com

    No of time visits : 3
    Cheers,
    Dinesh

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ajaxdinesh View Post
    if u define the canonical link in the website to only avoid the duplicate pages.

    its correct?

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

    Duplicate urls
    http://example.com
    http://www.example.com/index.html

    whoever to visit these duplicate urls
    http://example.com
    http://www.example.com/index.html

    google consider this one http://www.example.com

    So google analytic to generate the report in the top content section

    For Example

    Visit no 1 - http://example.com
    Visit no 2 - http://example.com/index.htm
    Visit no 3 - http://www.example.com

    URL
    http://www.example.com

    No of time visits : 3
    A better alternative than that is to just have all of those addresses automatically redirect to just the one address so that not only the search engines but everyone sees the one address regardless of what was typed in.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  8. #8
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Precisely, Stephen. Why do more work than is necessary?

  9. #9
    SitePoint Zealot ajaxdinesh's Avatar
    Join Date
    Apr 2009
    Location
    India
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    A better alternative than that is to just have all of those addresses automatically redirect to just the one address so that not only the search engines but everyone sees the one address regardless of what was typed in.
    I am not clear what r u saying?
    Cheers,
    Dinesh

  10. #10
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Ajax:

    that "canonical" thing is for people who have web sites like for example a shopping cart, where different URLs can go to the same product (the same content). Search engines are always looking our for "duplicate content" where people deliberately copy and redistribute content (across their own site or multiple sites) for higher search rankings. But if you have the shopping-cart problem like I just said, then you're not doing that for rankings, but because that's how your site works.

    And this should be ok. Google made the canonical thing up, so the best it can do is maybe help Google out-- other search engines don't have to follow it, and could penalise your site for "having duplicate content". This is because search bots see every URL as unique, a whole new page, even if it's really just the same single page with a bunch of URLs.

    So the better thing to do, as Stephen and Dan said, is to configure your server (don't ask me how) to make visitors only be able to get to that product or page via ONE URL and no others. *edit, oh, just redirects. So these changes are set in your HTTP headers on the server with I'm guessing the 303 or 302 (I can't keep those two apart, one is more appropriate than the other).

    Some people don't have that sort of access to their hosting server, which I'm thinking is why the canonical link is popular.

  11. #11
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's 301 and 302, Stomme poes. 301 is "permanent" (I moved; forward all my mail here) while 302 is temporary (I'm on vacation; hold my mail for a few days).

  12. #12
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Hmmm but when the page isn't moved, temporarily or otherwise, but simply is found in one place, I thought 303 "see other" was correct? But one of them (302??) is always abused?

    I thought a 301 was for example you had one page one url somewhere but switched domains or changed the html's filename or whatever?

    Yeah luckily I haven't had to configure servers yet but that day is looming, I'd better learn it now.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •