nuxt-community/sitemap-module

Cannot specify http or https routes in config

luismasserral opened this issue · 1 comments

I have installed and configured the extension, and it seems to be working fine. But when I see the final result in the URL, the generated URLs are with http instead of https. This is the configuration that I have:

  sitemap: [
    {
      path: '/sitemap-index.xml',
      sitemaps: [
        {
          path: '/sitemap-landing-pages.xml',
          routes: ['/menopause', '/over40', '/program', '/tour', '/weight-loss', '/young'],
          exclude: ['/**'],
        },
        {
          path: '/sitemap-static.xml',
          routes: () => {
            return ['/', '/contact', '/our-cause', '/privacy', '/terms'];
          },
          exclude: ['/**'],
        },
      ],
    },
  ],

As you can see in this URL https://reverse.health/sitemap-index.xml, even if the hostname and the URL are secured with https, the routes printed are non-secured, with http. We have some sub-domains that are not accesible through any process.env variables, so I cannot make them dynamic and create the full URLs by myself.

Am I missing some kind of configuration? I took a look at all the properties in the docs and saw nothing https://sitemap.nuxtjs.org/usage/sitemap-options.

Thanks! :D

Hi @luismasserral,

You can try to set the hostname attribute in your configuration as below:

 sitemap: [
    {
      path: '/sitemap-index.xml',
      hostname: 'https://reverse.health/',
      sitemaps: [
        // ...
      ],
    },
],