Issue
We have detected that the page canonical URLs of each existing language always point to the default language URL.
Our default language is English, and we have a page in two languages:
- English: http://www.example.com/en/products
- Spanish: http://www.example.com/es/productos
If you check their canonical URLs, both pages have the same pointing to the English version:
<link href="http://www.example.com/en/products" rel="canonical">
The expected behavior would be that every page's canonical URL points to its own language.
Environment
- DXP 7.2
- DXP 7.3
- DXP 7.4
Resolution
As of DXP 7.2, to improve the SEO of your pages there are some functionalities that will allow you to customize how canonical URLs are generated for your pages.
Configuring SEO Globally
In System Settings > Pages > SEO there is a new configuration option. Here you may choose from two options:
- Use Default Language URL (enabled by default). When visiting a page in any supported language, the URL of the default language will be used as its canonical URL.
- Use Localized URL. This option will make the current localized URL the canonical one.
Customizing a Page Canonical URL
Although the global configuration is useful in the general case, sometimes there are situations where you need to customize it at the page level.
In the page settings, there is an SEO panel where with a field to customize the canonical URL to use.
Additional Information