This is the script that I added on your site's .htaccess file:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
You just need to replace this "www.yourdomain.com" with your site's actual URL format. 🙂
https://www.hostgator.com/help/article/hostgator-free-ssl#action