Http https www na non-www

Snazim sa o to ,aby mi aj http aj https presmerovalo na https://stranka.sk/ ale pri https mi to nefunguje.
Viete niekto poradit ?

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Pokial nie si za varnishom alebo na nejakom divnom hostingu tak by malo stacit odkomentovat to co poskytuje core.

Podmienku RewriteCond %{HTTPS} !on

nahrad tymto:

RewriteCond %{HTTP:X-Forwarded-Proto} !https

toto ale pridava iba Varnish, ked ti request iba prechadza cez apache, tak tam taka hlavicka nie je.

To je skor otazka load balance…kludne to bude robit aj nginx…