Deployment passes old * subdomain to Hugo in $URL

How to reproduce

  1. Have an old Hugo site on the default * subdomain
    By old I mean that it was first configured before the switch to the * subdomains.

  2. Access your site’s sitemap, e.g. ( also works and just redirects to the former)

  3. In the sitemap XML all specified URIs still use the * subdomain.

Impact: For your * site you cannot register the sitemap in Google’s webmaster tools as it rejects the sitemap saying that it can only process URIs on the same subdomain (i.e. with *

Workaround: Open netlify.toml in your Hugo project and edit

  command = "hugo --gc --minify -b $URL"
  publish = "public"


  command = "hugo --gc --minify -b"
  publish = "public"

Hey @ComFreek! thanks for posting that. As announced, we are doing some migration work at present - we’ll check in on this behaviour soon!

Should be fixed as of 17:11 UTC yestrday @ComFreek - could you confirm that you URL is returning the right thing now?


Thank you, it is working as intended now!

1 Like