seo
#
Make canonical URL absoluteThe metatag module gives you the ability to overwrite the 'canonical' metatag:
On the module's settings page (/admin/config/search/metatag)
- Edit the General type
- Under Advanced you'll find the Canonical field
- Set the field's value to [current-page:url:absolute]
- Save
#
Fix the Metatag + Drupal Core bug on the canonical tagIf you have multiple query strings (ie. pagination + another variable in a view), the core + metatag escape the &
:
<link rel="canonical" href="http://harmoniemutuelle.dev.dd:8083/faq?title=&field_st_target_target_id=All&page=1"/>
instead of
<link rel="canonical" href="http://harmoniemutuelle.dev.dd:8083/faq?title=&field_st_target_target_id=All&page=1"/>
The solution is to add this function in your myTheme.theme file:
(this function is already present in the Stickers theme)