Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter-SSLHook - Appropriate headers and redirection for SSL websites
#1

This hook will force users to use your HTTPS version of the website, it will also set some extra headers.

More details here:
https://github.com/mehdibo/Codeigniter-SSLHook
Reply
#2

It's my opinion that the application layer is the wrong time to redirect users to HTTPS. Apache makes it extremely easy to do this kind of redirect:

Either this:

Code:
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

or I'd usually use this:


Code:
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Reply
#3

(04-13-2018, 05:22 PM)skunkbad Wrote: It's my opinion that the application layer is the wrong time to redirect users to HTTPS. Apache makes it extremely easy to do this kind of redirect:

Either this:

Code:
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

or I'd usually use this:


Code:
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

I agree actually, it'll be faster if you redirect using .htaccess and even the headers can be set there but... I already made it ¯\_(ツ)_/¯
Reply




Theme © iAndrew 2016 - Forum software by © MyBB