seo
seo copied to clipboard
Sitemap url's
Description
I'm hosting my craft site on multiple subdomains. cms.mywebsite.com and www.mywebsite.com
The cms website is the main url set in Craft and used to make changes to the content for the editor. These changes get pushed to a Netlify CDN at the www url.
The problem is that my sitemap contains references to the cms.mywebsite.com domain while I would like it to reference it to the www url's.
Is this possible or something we can add to this already great plugin?
So are you using Blitz to push to Netlify? I would have thought if you set the DEFAULT_SITE_URL
in your site config to the front end it should work - although we've only ever used the plugin with a decoupled front and back end in headless mode.
We have a project coming up where we're using Blitz to push to Cloudflare, so we may hit the same problem, and if we do, we'll implement a fix or come back to you with a solution.
Hey Alex,
I'm indeed using the Blitz plugin to push to a Git repository that gets read by Netlify.
The problem is that if I set the www url as default Blitz cache will go there to warm the pages but these pages don't exist on the www domain :D
Right now I warm the cache with the cdn.website.com url and do a find and replace on those pages to change cdn to www.
Anyway, I'll wait and see if you guys run into the same problem ;)
A quick and dirty work-around would be to replace the subdomains in the SEO output:
{% apply replace('cms.', 'www.')|raw %}
{% hook 'seo' %}
{% endapply %}
@Tam that does not seem to change the urls in the sitemap itself?