summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-03 06:47:23 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-03 06:47:23 +0000
commit0d8515deb750fe2a02ee6f9f12860caceed7248f (patch)
tree9898c0801cec5188f8e54229a2760a4ff15f44f5 /modules/node
parent3b2d24af0b8ca83415310e2b328cc60fa830837b (diff)
downloadbrdo-0d8515deb750fe2a02ee6f9f12860caceed7248f.tar.gz
brdo-0d8515deb750fe2a02ee6f9f12860caceed7248f.tar.bz2
#552478 by pwolanin, samj, dropcube, and sun: Improve link/header API and support on node/comment pages rel=canonical and rel=shortlink standards.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 84cc776ff..735fc30c4 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2152,6 +2152,10 @@ function node_page_view(stdClass $node) {
if (isset($return['nodes'][$node->nid]['title'])) {
drupal_set_title($return['nodes'][$node->nid]['title']['items'][0]['#item']['value']);
}
+ // Set the node path as the canonical URL to prevent duplicate content.
+ drupal_add_html_head_link(array('rel' => 'canonical', 'href' => url('node/' . $node->nid)), TRUE);
+ // Set the non-aliased path as a default shortlink.
+ drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url('node/' . $node->nid, array('alias' => TRUE))), TRUE);
return $return;
}