PHP
  Home arrow PHP arrow Page 2 - Using the Link Rel Canonical Tag
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Using the Link Rel Canonical Tag
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2009-05-07


    Table of Contents:
  • Using the Link Rel Canonical Tag
  • Theory of Implementation
  • Implementation Steps
  • Implementing a Canonical Version, First Scenario
  • Implementing Canonical Version for a Secure Website

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using the Link Rel Canonical Tag - Theory of Implementation
    ( Page 2 of 5 )

    To understand how to implement this, we must illustrate first how 301 redirection is used to solve this type of problem. Consider the example below, which illustrates a typical non-www and www canonical issue:

    Googlebot sees a non-www URL during a crawling session ---> http://somewebsite.com/myfile.php ---> if non-www ---> server will do a 301 redirect to the www canonical version ---> http://www.somewebsite.com/myfile.php ---> Googlebot indexes the www version

    Therefore, this means that if Googlebot sees any non-www URL, the server will do a 301 redirect so that Googlebot will index the canonical version.

    What should happen when we use the link rel canonical element? See the diagram below:

    Googlebot sees a non-www URL during a crawling session ----> http://somewebsite.com/myfile.php ----> Google sees the link rel canonical tag in the head section of this file <link rel="canonical" href="http://wwww.somewebsite.com/myfile.php" /> ------> Google indexes the canonical URL provided.

    This means that we have to place this tag in the <head> section so that if any non-www URL is being crawled, Googlebot will fetch the canonical www URL.



     
     
    >>> More PHP Articles          >>> More By Codex-M
     

       

    PHP ARTICLES

    - Adding Ordering and Grouping Clauses to the ...
    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek