By Gurotec
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!
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:
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.