Closed LorensoD closed 3 years ago
Hi @LorensoD ,
Thank you for reporting, has the Canonical URL
been overridden for the pages which aren't producing absolute URLs?
In the eventix sitemap it looks like the pages which aren't generating absolute links are duplicates of other entries, I'm wondering whether it may be that the URL in the canonical field is simply a relative URL.
I'll get a fix in place to ensure that the canonical URLs we're pulling in are transformed to be absolute before putting them in the Sitemap.
This should now have been fixed in 2.0.12 :)
Doesn't seem to fix my issue 🤔.
The Canonical URL
has not been overridden for those pages. But interestingly enough. When I change the Canonical URL
of a duplicate page the following occurs:
I changed the
Canonical URL
of the page to /help/create-scanner-login-test
.
Do I maybe need to completely regenerate my sitemaps? And if yes, how do I achieve this?
Hi @LorensoD ,
The sitemap can be regenerated by refreshing the cache (php please cache:clear
), that would be my first thought, could I also check that all the sites that are in Statamic have full URLs in the config (e.g. 'https://eventix.io' or 'http://127.0.0.1:8000') rather than just '/'.
I don't think the above is required as the absoluteUrl()
function on the Statamic Site
object does fall back to using the request data (as seen here), but it's still worth checking as this is my next thought on what could be causing this.
Hi @AndrewHaine,
Thanks for your message! I've checked my sites.php
and it seems that every site has a full URL.
Hi @LorensoD ,
I've been testing my local site this week and I'm still unable to replicate any non-absolute URLs appearing in the sitemaps, would it be possible for me to get read-only access to your repo in order to ensure my testing conditions are identical to what you're working with?
Thanks, Andrew
Hi @LorensoD ,
Thank you for sending me access to the site, I've identified the issue as being to do with entries which are redirect pages. Statamic was giving us a non-absolute value as a result of getting the redirect URL.
The fix I've applied is to filter out any entries which are redirect pages as it's best that they don't get placed in the sitemap.
The latest release (2.0.14) contains this fix :)
Thanks, Andrew
Hi @AndrewHaine,
I can confirm that this fix works and solves my issue. 🎉 Thanks for your help!
How is it possible that my automatically generated sitemap contains URLs without the domain?
https://eventix.io/sitemap_help_pages.xml