How to force my site from Http to Https

Good Day everyone,
How i can force my site to use Https? i am using Heroku and Godaddy, i already tried force-ssl package, but when i try to access my site using http it redirects me to the https://www.mysite.herokuapp.com instead of https//www.mysite.com.
Thanks in advance

I use a hacked version of the force-ssl package for one app (which uses subdomains for different tenants, which is why the actual package wasn’t working for me – at least, not 3 years ago when I set the app up) and, for all others, I use nginx for both ssl termination and for redirecting http to https. The guide section about forcing SSL provides a few ideas.

1 Like

if it’s redirecting you to site.herokuapp.com, it might be because of your ROOT_URL. What are you using as ROOT_URL?

1 Like

on the tutorial that i followed, i can’t change the default root url in heroku, and all i can do is to point it from godaddy.

Try heroku config:set ROOT_URL=https://yoursite.com

2 Likes

cloudflare?

1 Like

@saintjs did it work? did you solve your problem with another solution?

1 Like

Thank you all. i first solve my problem by writing a script to force my site to redirect to https, and also i tried to change the root url on heroku dashboard and it works really well now using force ssl package.

Just do it in cloudflare it will redirect faster than loading and running a script.