How does certbot force https?

I just setup https for one of my websites and at the end of the process, certbot asked if I wanted to force https. I chose not to because I wasn’t sure if everything would work correctly over https. There are a couple issues I need to solve, but after that I’d like to force https.

How does certbot do this? Does it add code to the VirtualHost or something else? Thanks.

Yeah, it puts a 301 redirect on the http vhost to redirect it to https.

Any chance you could post that code? I wanna see exactly how it does it.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.