diff --git a/usagov_benefit_finder/modules/usagov_benefit_finder_app/usagov_benefit_finder_page/usagov_benefit_finder_page.module b/usagov_benefit_finder/modules/usagov_benefit_finder_app/usagov_benefit_finder_page/usagov_benefit_finder_page.module index cc6d53e6a..add471913 100644 --- a/usagov_benefit_finder/modules/usagov_benefit_finder_app/usagov_benefit_finder_page/usagov_benefit_finder_page.module +++ b/usagov_benefit_finder/modules/usagov_benefit_finder_app/usagov_benefit_finder_page/usagov_benefit_finder_page.module @@ -42,6 +42,13 @@ function usagov_benefit_finder_page_page_attachments_alter(array &$page) { if ($node && $node->bundle() == "bears_life_event") { if (\Drupal::routeMatch()->getRouteName() == 'entity.node.canonical') { $page['#attached']['library'][] = 'usagov_benefit_finder_page/benefit_finder_app'; + $url = $node->toUrl('canonical')->setAbsolute(TRUE); + $page['#attached']['html_head_link'][] = [ + [ + 'rel' => 'canonical', + 'href' => $url->toString(), + ], + ]; } } }