getgrav / grav-plugin-sitemap

Grav Sitemap Plugin
https://getgrav.org
MIT License
42 stars 42 forks source link

How to get sitemap to generate https instead of http? #49

Closed drnasin closed 3 years ago

drnasin commented 6 years ago

I have ForceSSL and seems like sitemap is generating http. How can I get it to generate https for items?

humhann commented 6 years ago

Seems that both work: http://localhost/sitemap https://localhost/sitemap

Would it make sense that http version redirects to https when ForceSSL is enabled?

CSixtyFour commented 6 years ago

@drnasin I had this same issue because I've got SSL offloading and Grav doesn't take this into account. I've raised a PR against Grav which resolved the issue for me https://github.com/getgrav/grav/issues/1827 HTH

drnasin commented 6 years ago

@CSixtyFour How did yo solve this? On my production server sitemap still generates http instead of https...locally it's ok...weird...

CSixtyFour commented 6 years ago

@drnasin For me it wasn't the sitemap itself that was the issue but Grav core uri coming through incorrectly (either http or https://url.com:80) which https://github.com/getgrav/grav/issues/1827 fixed for me. Its just two small code blocks so I've been manually patching after updates until that PR pulls through

drnasin commented 6 years ago

@CSixtyFour Yeah I saw your pull request. Just what I need. I didn't want to mess with the core files. is there a reason why it's still not released?

CSixtyFour commented 6 years ago

I have no idea @drnasin maybe it hasn't been tested by the Grav core team yet or maybe there's a better way to achieve the same result. I think there's been about 3 releases since that PR so manual updating is a pain but not really a hassle.

drnasin commented 6 years ago

@CSixtyFour so there's no cross posting - https://github.com/getgrav/grav/issues/1827#issuecomment-392970715 - the guys are aware and baffled :)

NicoHood commented 3 years ago

This has been fixed, the issue can be closed.