The most common way to force traffic to use the https protocol is to redirect requests via an .htaccess file. An .htaccess file is a simple text file called “.htaccess” that contains additional settings passed to the web server to support some of the more complex features. If you are using a script created by someone else (including a content management system such as WordPress), you will most likely already find the .htaccess file in the htdocs folder of your website. If you don't already have an .htaccess file, you can use a file manager to create a file called .htaccess. It is recommended that you use a file manager, as some systems (especially Windows) do not support .htaccess files well.
Once you have found or created the .htaccess file, you can edit it using a file manager or any text editor such as Notepad. You will need to add the following lines of code to the file:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:CF-Visitor} ! {"scheme": "https"}
RewriteRule (. *) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Source : https://forum.infinityfree.com/docs?topic=49322










