How to force my site from Http to Https


#1

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


#2

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.


#3

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


#4

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.


#5

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


#6

cloudflare?


#7

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


#8

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.


#9

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