Is there a way to force HTTPS protocol in a Kohana 2.3 site?
- by alex
I've got a site built on top of Kohana 2.3 which I now have to make all links https.
I set this in application/config/config.php.
$config['site_protocol'] = 'https';
This makes all links on the site use the https protocol.
Except, when I first enter the site via http, it will not automatically forward to https.
Is there a way to make Kohana do this, or do I just need to do some custom coding?
I've found this .htaccess rule too, will it be fine to just drop this in?
RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ https://yourdomain.tld%{REQUEST_URI} [NS,R,L]
Thanks.