Index: globalredirect.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/globalredirect/globalredirect.module,v retrieving revision 1.1.2.4.2.5.2.14 diff -u -r1.1.2.4.2.5.2.14 globalredirect.module --- globalredirect.module 22 Dec 2008 10:34:32 -0000 1.1.2.4.2.5.2.14 +++ globalredirect.module 13 Feb 2009 19:43:49 -0000 @@ -158,6 +158,16 @@ // Restore the destination from earlier so its available in other places. if (isset($destination)) $_REQUEST['destination'] = $destination; } + + // Add the canonical link to the head of the document if desired. + if (variable_get('globalredirect_canonical', FALSE)) { + drupal_add_link(array( + 'rel' => 'canonical', + 'href' => url(drupal_is_front_page() ? '' : $_REQUEST['q'], array( + 'absolute' => TRUE, + )), + )); + } } Index: globalredirect.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/globalredirect/Attic/globalredirect.admin.inc,v retrieving revision 1.1.2.6 diff -u -r1.1.2.6 globalredirect.admin.inc --- globalredirect.admin.inc 22 Dec 2008 11:43:41 -0000 1.1.2.6 +++ globalredirect.admin.inc 13 Feb 2009 19:43:49 -0000 @@ -69,6 +69,13 @@ '#default_value' => variable_get('globalredirect_case_sensitive_urls', GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED), ); + $form['globalredirect_canonical'] = array( + '#type' => 'checkbox', + '#title' => t('Add Canonical Link'), + '#description' => t('If enabled, will add a canonical link to each page.', array('!canonical' => 'http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html')), + '#default_value' => variable_get('globalredirect_canonical', FALSE), + ); + return system_settings_form($form); }