Blogs for domain and sub-domain not getting https

@joohoi: Thank you so much for every educational reply. I followed and it worked perfectly but:

  • the main site thegioitours.com is always redirected to https, but not the sub-domain site, in this case was beta.thegioitours.com. Do I need to put specifically ServerAlias beta.thegioitours.com in the /etc/apache2/sites-enabled/000-default.conf and reinstall the certificate again?

  • if that the case, whenever we add another blog as sub-domain later, we will have to repeat (add serveralias in the conf file and reinstall certificate) like with the beta.thegioitours.com above?

  • and what is the purpose of certificate for *.thegioitours.com?

Sorry for a newbie asking many questions and appreciate all the helps.

I don't think so.
You may need an additional vhost config for each site that will use a separate DocumentRoot.

To cover all the future sites:
beta.thegiotours.com
lima.thegiotours.com
zeta.thegiotours.com
...

I see. Wonder why the beta.thegioitours.com is still not with https then?

https://beta.thegioitours.com/ works.
But http://beta.thegioitours.com/ doesn’t auto forward to https://beta.thegioitours.com/

Show where you do the https forwarding.
You would need to do something similar for each new site or globally for all sites.

# curl thegioitours.com
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href=“https://thegioitours.com/”>here</a>.</p>
</body></html>

Thanks @rg305
In my case - a simple wordpress blog - I google’d and added following to .htaccess file and everything seemed working fine. I also tested to add another sub-domain blog and got redirected to https as well. So all looks good for now (until 90 days later :slightly_smiling_face: ) Appreciate everyone’s help!!

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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