I recently acquired my first encrypted website. Following some advice I received from the SitePoint forums, I added a rule to my .htaccess file to make all my pages default to https, so that anyone following a link to http/my article would be redirected to https/myarticle.
It works great, but I just ran into a weird problem when I created a subdomain. I didn’t realize that subdomains of encrypted sites apparently aren’t https themselves. So when my .htaccess file redirects a subdomain URL to https, it’s directing it to a URL that doesn’t exist.
My webhost fixed the problem by putting a .htaccess file in my subdomain folder with a simple rule that overrides the https default. So my subdomain now defaults to http.
It works fine for me, but I just wondered if it would be better to have my subdomains encrypted along with the main site. It just seems strange to have an encrypted site with unencrypted subdomains. I’m using this particular subdomain to host a WordPress blog, by the way.
This is what my webhost told me:
The only way a subdomain would redirect is if the directory above the subdomain has rewrite rules that trickle down to said subdomain’s directory. So, in your situation, the .htaccess in your public_html had rules that redirected your subdomains to https. Because those subdomains didn’t have a SSL installed, the redirect tossed the subdomains to the first ssl vhost in the apache configuration.
In order to counter the .htaccess rules, I disabled the redirection within each of the subdomains’ main directories, which corrected the issue for you. If you need these subdomains to resolve to https://, you might want to look into a wildcard SSL to cover the main domain, hostname, and other subdomains atgeobop.com. Let me know your thoughts on what I’ve said, and if you have any questions- do not hesitate to ask.
So I did a little research on wildcard SSL’s and see I have more homework ahead of me. It sounds like I would have to purchase a SSL.
To cut to the chase, can anyone tell me, first of all, if there are any specific reasons to encrypt or not encrypt subdomains of an encrypted site?
If encrypting them is a good idea, how much do wildcard SSL’s generally cost (roughly)?
Thanks.