+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Canonical URLs link (tags) plugin

Hybrid View

  1. #1
    Senior Member
    Join Date
    Aug 2010
    Posts
    174

    Canonical URLs link (tags) plugin

    Canonical URL link (tag) in between head sections of the HTML code, will benefit website for SEO purpose.
    Example canonical link (tag):
    <link rel="canonical" href="http://www.flynax.com/" />
    OR
    <link rel="canonical" href="http://www.flynax.com/features.html" />

    This will reduce a duplicate content issue with search engines!
    This link should be added to all important pages, such as categories.

    For example:
    The canonical link for the page URls below should be as following:
    <link rel="canonical" href="http://www.flynax.com/features.html" />

    Sample page URLs:
    http://www.flynax.com/features.html
    http://www.flynax.com/features.html?...inamic_content
    http://www.flynax.com/features.html/index2
    http://www.flynax.com/features.html/index3

    (all the pages above; the search engine consider as the same pages. In this case, the canonical link (tag) will tell search engine where the main URL is located)

    This is will avoid PENALTY of the search engines for duplicate content on the website.
    Last edited by PGGO; April 27, 2012 at 04:56 AM.

  2. #2
    It's very simple to do :

    open the header.tpl of your theme (/templates/yourtemplate/tpl/header.tpl) and search

    <meta name="keywords" content="{$pageInfo.meta_keywords|strip_tags}" />
    add after

    <link rel="canonical" href="{$pageInfo.canonical}" />

    after it, open the file common.inc.php in the includes folder, search :

    /* send headers */
    header("Content-Type: text/html; charset=utf-8");
    header("Cache-Control: store, no-cache, max-age=3600, must-revalidate");
    and add after this code:

    $page_info['canonical'] = RL_URL_HOME;
    $page_info['canonical'] .= $config['mod_rewrite'] ? parse_url(substr($_SERVER['REQUEST_URI'],1),PHP_URL_PATH) : "index.php?".$_SERVER['QUERY_STRING'];

  3. #3
    Member
    Join Date
    Jan 2019
    Location
    uk
    Posts
    47
    my code for this is in head.tpl not header.tpl does it matter can I use code in head.tpl?

  4. #4
    I dont really understand what this do. Is this good to implement to the site ?
    Can anyone tell me in details what this do ?

  5. #5
    Here some informations : http://en.wikipedia.org/wiki/Canonical_link_element

    Google penalizes websites where find duplicate elements. But sometimes Google arrive to one page from two or more links, and don't understand that this page is the same page.

    With canonical tag you help google to understand that it's not a duplicate and save your website from penalize.

  6. #6
    Senior Member
    Join Date
    Aug 2010
    Posts
    174
    Fabrizio,

    Thank you very much!

    It works great.

  7. #7
    You welcome ;-)

  8. #8
    Hello Fabricio, I just found the thread, thanks very much for posting it! I'm having quite a lot of duplicate content from my site in Google and I'm sure this is going to help, thanks again!

    Robert

  9. #9
    I'm pretty sure this doesn't really work.

    When I go to my website normally it produces:
    <link rel="canonical" href="http://www.MyDomain.com/" />


    And when I add "/index.php" to the end of the URL I see in the source:
    <link rel="canonical" href="http://www.MyDomain.com/index.php" />


    I can also generate:
    <link rel="canonical" href="http://www.MyDomain.com/about-us.html" />

    And

    <link rel="canonical" href="http://www.MyDomain.com/about-us/" />


    I think the whole point of canonical is to have it pick one version and always use it for the same page, so duplicates aren't indexed by google. Anyone have ideas for solving this?

    Thank you

  10. #10
    Hi all

    after it, open the file common.inc.php in the includes folder, search : includes>controllers>common.inc.php right directory
    Thanks PGGO,ATServiceSRL

+ Reply to Thread