/ Published in: PHP
For our project, this code had been implemented in the theme template.php
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function yourtemplate_preprocess_html(&$vars) { // get the request parameters $canon = 'http://www.marlux.com' . $reqParams[0]; // create a canonical object '#type' => 'html_tag', '#tag' => 'link', 'name' => 'canonical', 'content' => $canon, ), ); // add the canonical object to the html head drupal_add_html_head($canonical,'canonical'); }
URL: www.marlux.com