Report this

What is the reason for this report?

I cannot redirect the subdomain to SSL

Posted on January 23, 2020

I cannot redirect the subdomain to SSL. My domain is izybai.com, it’s good. But when I write the subdomain manager.izybai.com it does not redirect me to SSL, that is, as if I did not have an SSL certificate.

Virtual host archive:

VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName izybai.com
    ServerAlias www.izybai.com
    DocumentRoot /var/www/izybai.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName gestor.izybai.com
    ServerAlias www.gestor.izybai.com
    DocumentRoot /var/www/izybai.com/backend
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Please help me!

Thansk!



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.

Hello,

What I could suggest here is to use certbot to issue a new SSL certificate for your subdomain and then also let certbot add the redirect to HTTPS automatically for you.

If you have certbot already installed, then you can do that with the following command:

sudo certbot --apache -d gestor.izybai.com -d www.gestor.izybai.com

You should see the following output in the end:

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

If you choose option number 2, then certbot will add the redirect for you.

For more information you can take a look at this tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04

Hope that this helps! Regards, Bobby

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.