Search code examples
apachehttp-redirecthttpsportports

What is the best and most secure way to forward http to https or port 80 to 443 Apache?


So I am looking for the best way to setup my https ssl website. I will show you my current configuration.

000-default.conf - https://i.sstatic.net/hC3qD.png

ports.conf - https://i.sstatic.net/I7uMH.png

I want it so if someone types website.com or www.website.com it goes to https ://www.website.com

I already have it setup so it does this. But is this secure and the most effective way of doing it? Do I even need port 80 at all and have people not need to type https manually?

I hope I explained my situation well enough. Any help and advise would be appreciated!


Solution

  • Your simple Redirect in a port 80 virtualhost to the port 443 vhost is perfectly normal/fine. It's secure and effective and not something to dwell on.