With the web transforming nearly every day, and the need for privacy and security growing higher and higher, there is a huge demand on web developers now a days, to provide even if the site is purely informational; A SSL certificate for some level of encryption on the input/output of the data from their sites, services, other. With that demand comes the need to drive your traffic to the right place to ensure that security they are looking for.

Now while the code under the hood remains fairly the same, your server isn’t likely going to by default at least redirect your traffic from http://domain.com to https://domain.com.

One way to enforce the use of protocols is to add a couple quick lines to the top of your .htaccess file (depending how you have it setup at least). 

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]

This is basically checking to see if the requested protocol from the browser is HTTP if it is (ie: off) then redirect your request premaritally via 301 header being used while redirecting from http to https the request you made.

If you are using wordpress you could also install these two plugins to make it even easier. The first one involves the actual redirection from protocol to protocol while the other will help you obtain and automatically re-obtain on expiration a SSL certificate for free The first plugin is Easy HTTPS (SSL) Redirection the next is WP-Encrypt provided by the free cert authority Let’s Encrypt though I do not advice using Let’s Encrypt if you are doing e-Commerence or other similar service where extremely sensitive data is passing hands.