Summary
The canonical tag on custom pages, from the second level onwards, directs only to the first level.
Example:
The folder /institutional, directly in the site's root, will have the canonical tag pointed correctly to www.website.com/institucional.
The folder /institucional/our-stores, being a subfolder, will have the canonical tag pointed incorrectly to www.website.com/institutional, while it should point to www.website.com/institucional/our-stores.
Simulation
- Enter the CMS;
- In Layout, create any two folders, one contained within the other;
- Associate HTML templates so you'll have content;
- Access the page on the store's front end;
- Check the canonical tag that was printed in the second folder of the hierarchy.
Workaround
Because it is a customized content, the best way to get around this problem is to disable the canonical tag using the following control: <vtex.cmc:canonicalPage disable="true"/>. Then manually create the canonical tag for each page.
Suggestion: Use placeholders in the template to have a settings field in each layout/folder that uses these templates.