Monday, April 15, 2019

.htaccess - One wildcard SSL certificate to work on my subdomain sites using wildcard subdomains, and on my single subdomain site not using the wildcard subdomain

I have a WordPress multisite on domain mysite.com, this allows you to create multiple sub domain sites (test1.example.com, test2.example.com etc).
It uses wildcard subdomains where you add a * in cpanel > subdomains. Here is the htaccess code:




RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]



I can configure a wildcard SSL certificate to work for this, all subdomains on this WordPress network will have https.



I also have a non-WordPress site running on the same domain: (myothersite.mysite.com). This site doesn't use wildcard subdomains, I have to set up the subdomain name in cPanel > subdomains by adding the subdomain 'myothersite', as it won't work with the * (wildcard subdomain).



My question is, is there a configuration that will allow me to use the same wildcard SSL certificate on my non WordPress site?



Because at the moment, I need 2 SSL certificates. I need a wildcard SSL certificate which handles all the subdomains on my WordPress multisite, and a single SSL certificate for my non WordPress subdomain site.




Any help appreciated.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...