Remove trailing slash from TLD in base_href, menus etc

Is there some way in Revo to remove the trailing slash from the TLD in menus? I’m trying to eliminate any duplicate content concerns.

I have my server redirects in MODX Cloud pointing everything to https://mydomain.com, and this works correctly, but in my base_href, wayfinder menus and sitemap.xml etc the home page url appears as https://mydomain.com/

The site_url setting is set as https://mydomain.com and I have set container_suffix to blank.

Wouldn’t a canonical tag in the head section solve this? It would be easier.

There is no technical difference between https://site.com and https://site.com/ and even if there was, search engines would be clever enough to recognise those as the same thing.

There may be a difference between https://site.com/folder/ and https://site.com/folder, however you already emptied the container_suffix and there’s also an automatic redirect by default if I recall correctly.

MODX expects the site_url to always end in a slash so I do recommend adding back the slash to avoid issues.

Thanks for your response(s). It’s mostly a matter of housekeeping as my client is on an SEO kick and has been advised to make some changes to the canonicalization.

Mark, your explanation of the similarity between the home page url with and without a / was my understanding also but in what was perhaps an oversight, I had the canonical tag set to [[++site_url]] for the home page and [[++site_url]][[~[[*id]]]] for the rest - therefore while canonicalization worked correctly for all deeper pages, the index was still incorrect with the /. To solve this I have simply hard coded the canonical TLD on the home page now.

The initial problem hasn’t changed but hard coding the canonical without the / on the home page should address any concerns they have.

Thanks again.

You can use this to have the correct canonical URL on all pages as a full url:

[[!~[[*id]]? &scheme=`full`]]
1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.