Report this

What is the reason for this report?

Redirect HTTP domain A to HTTPS domain B (with lets encrypt cert installed already)

Posted on June 22, 2017

I would like to redirect domain A that is not secure (http) to domain B that is secure (https) that has a let’s encrypt ssl cert already installed. I believe the answer to my question is to utilize the rewrite rules. But, the documentation is a little difficult to understand -for me. Any help, with examples would be awesome.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @michel92df116ca8bc0546fb67

You can use the following method to redirect by changing your VirtualHost:

<VirtualHost *:80>
  ServerName domainA.com
  Alias www.domainA.com
  Redirect / https://www.domainB.com/
</VirtualHost>

And the restart Apache with sudo apachectl restart If everything works, then change it to Redirect permanent / https://www.domainB.com/

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.