redirection

How to Properly Redirect from HTTP to HTTPS?

I'm looking for the best way to redirect users from a public website (like example.com) to its secure version (https://www.example.com) when they enter either example.com or www.example.com in…