@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.
# 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 ) Appreciate everyone’s help!!
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]