redirect to https codeigniter

C#
https://www.phpkida.com/redirect-http-to-https-using-htaccess/

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</IfModule>
Source

Also in C#: