getgrav / grav-plugin-sitemap

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

Support for SSL #46

Closed jrivero closed 7 years ago

jrivero commented 7 years ago

The generated urls for the sitemap when the site is ssl not have https. The "force_ssl" setting has no effect.

conradfr commented 7 years ago

+1

As a workaround you can modify line 75 of user/plugins/sitemap/sitemap.php with:

$entry->location = str_replace('http://', 'https://', $page->canonical());

flaviocopes commented 7 years ago

HTTPS should be used if $_SERVER['HTTPS'] is true on the server. Enforcing https via htaccess (on Apache) should work: https://stackoverflow.com/questions/4398951/force-ssl-https-using-htaccess-and-mod-rewrite

conradfr commented 7 years ago

Well my host use $_SERVER["HTTP_HTTPS"] instead of _SERVER["HTTPS"], I think it depends on the Apache version.

flaviocopes commented 7 years ago

Oh, I read about it, that looks like an issue with Nginx. Are you using Nginx?

flaviocopes commented 7 years ago

(related issue https://forge.typo3.org/issues/32341)

jrivero commented 7 years ago

I use nginx and the set of HTTPS header to on has solutionated the problem. Thanks!

jorbascrumps commented 6 years ago

I see a workaround posted here, but is there word on an official fix?