nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
162 stars 68 forks source link

Sitemap URL inconsistencies #1470

Closed stevehurst closed 1 month ago

stevehurst commented 1 month ago

Our client is reporting inconsistencies in their sitemap URLs that is causing errors for them in SEMrush and other reporting tools.

When I look at their sitemaps, I see a mix of complete URLs with domain name, and some that are only absolute links to pages. According to my client, this varies from week to week. I'm not able to find any canonical setting in the SEOmatic settings to make sense of this from section to section in Craft. How are they generated?

See here: https://kalypso.com/sitemaps-1-sitemap.xml https://kalypso.com/sitemaps-1-section-about-1-sitemap.xml https://kalypso.com/sitemaps-1-section-caseStudies-1-sitemap.xml

Attaching images, since the live versions can be inconsistent.

Screenshot 2024-05-21 at 10 49 52 AM Screenshot 2024-05-21 at 10 49 45 AM Screenshot 2024-05-21 at 10 50 10 AM
khalwat commented 1 month ago

How are you setting the site's URL? SEOmatic just asks Craft for the URL to the entries, so ensure that your primary site URL is set properly.

Also, is there anything special about the about section, which appears to have the URLs not be correct?

stevehurst commented 1 month ago

It looks like we were not setting either DEFAULT_SITE_URL or PRIMARY_SITE_URL in the .env file on production, but we have added both and cleared cache and the sitemaps all seem to be consistent now! I bet that was having a negative impact elsewhere. Thanks for the lead.

There was nothing specific or different set about the sections that did or didn't show the full URL. Weird, but it seems to be be consistent now.