Proper HTML code when linking internally

Discussion in 'Search Engine Optimization' started by Rivers, Feb 5, 2008.

  1. #1
    hi everyone. quick question.

    What is the proper HTML code when linking internally? I mean, for example, is:

    <a href="index.html">home</a>

    better than

    <a href="http://mysite.com/index.html">home</a>

    ? does it matter?

    tnx
     
    Rivers, Feb 5, 2008 IP
  2. alvis

    alvis Peon

    Messages:
    111
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <a href="http://mysite.com/index.html">home</a> this is the right code when you are placing you are using anchor text.
     
    alvis, Feb 5, 2008 IP
  3. ifortune

    ifortune Peon

    Messages:
    50
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Use descriptive anchor text for all your text links. Most search engines consider anchor text of links when ranking pages.

    Link titles are like alt text for text links. Try to have keywords in the title and anchor text.

    Here's an example for internal linking:

    Syntax:
    <a href="page.html" title="This is a link title.">this link</a>


    For External or Outbound Links you can go with "Alvis"

    <a href="http://mysite.com/index.html">home</a> this is the right code when you are placing you are using anchor text.
     
    ifortune, Feb 5, 2008 IP
  4. Core

    Core Guest

    Messages:
    1
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Actually google advises to link using the full url(http+site+page) instead of just page call only internally(I would place examples but I'm new around here so it does not allow me to post links yet). It makes sense for example in the case if you copy the file elsewhere it will still work.
     
    Core, Feb 5, 2008 IP
    Rivers likes this.
  5. LawnchairLarry

    LawnchairLarry Well-Known Member

    Messages:
    318
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    118
    #5
    As mentioned previously, search engines prefer absolute URLs (i.e. the URL including HTTP and domain name), because these are easier for them to crawl and get the hang of the structure of your website. Most web developers, however, prefer to use relative URLs (i.e. the URL excluding HTTP and domain name), because this makes your web pages easier to maintain (less links need to be changed when the file is moved from one directory/location to another) and because this slightly reduces the file size. It is not mandatory to use absolute URLs, but if you want your website to be SEO friendly then you should use absolute URLs in combination with a proper description of the title attribute and anchor text, and use the rel attribute. For example:

    <a href="http://mysite.com/index.html" title="Return to the homepage" rel=”start”>home</a>
     
    LawnchairLarry, Feb 5, 2008 IP
    Rivers likes this.
  6. Rivers

    Rivers Peon

    Messages:
    276
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Nice. Thanks Larry. :D
     
    Rivers, Feb 5, 2008 IP
  7. LawnchairLarry

    LawnchairLarry Well-Known Member

    Messages:
    318
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    118
    #7
    Not at all!
     
    LawnchairLarry, Feb 6, 2008 IP
  8. neil patrick harris

    neil patrick harris Peon

    Messages:
    288
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ya I've always wondered about this too. I'm gonna go now and use the full urls in my site. :p Thanks.
     
    neil patrick harris, Feb 6, 2008 IP
  9. chaitanya.seo

    chaitanya.seo Banned

    Messages:
    625
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Very clever.:cool:
     
    chaitanya.seo, Feb 6, 2008 IP
  10. ColinPL

    ColinPL Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You can use href="index.html", href="/index.html" or href="full URL". There is no difference for search engines.
     
    ColinPL, Feb 7, 2008 IP
  11. attick

    attick Peon

    Messages:
    137
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #11
    So do you actually need the /index.html or just .com?
     
    attick, Feb 7, 2008 IP
  12. internetgal

    internetgal Peon

    Messages:
    117
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Same here :mrgreen:
     
    internetgal, Feb 7, 2008 IP
  13. Rivers

    Rivers Peon

    Messages:
    276
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Silly me... I should've checked DP's SEO FAQ first. :rolleyes:

    Should I use relative links or absolute links?

    Absolute links. It is recommended by Google as it is possible for crawlers to miss some relative links.

     
    Rivers, Feb 7, 2008 IP
  14. johneva

    johneva Well-Known Member

    Messages:
    1,480
    Likes Received:
    46
    Best Answers:
    1
    Trophy Points:
    170
    #14
    Erm actually my advise is never link to the index file as it gets treated as a different page to the domain name alone then, which is not good for a few reasons.

    <a href="http://www.mysite.com/">Home</a>
    Code (markup):
    Works much better. ;)

    As far as absolute or relative absolute is better for SE spiders and incase people copy content from your site, at least you have links that will work depending on how they copy the content.
     
    johneva, Feb 7, 2008 IP
  15. neil patrick harris

    neil patrick harris Peon

    Messages:
    288
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #15
    And if your worried about people copying your content put something like bhkqitttl in
    http://www.google.com/search?hl=en&q=bhkqitttl&btnG=Google+Search

    and link a period in your article to your homepage.;)
     
    neil patrick harris, Feb 7, 2008 IP