I have set up a Wordpress Multisite with LAMP successfully and it currently has the following structure
- a (wordpress primary domain)
- a1.a
- b
- b1.b
- b2.b
- b3.b
- c
I created virtual hosts configurations for the three domains mapping to the same WordPress Multisite directory, and I am running the WordPress MU Domain Mapping plugging to handle redirections and so far has been working great with http.
Then I created the certificates for https:
- cert 1 => a, *.a
- cert 2 => b, *.b
- cert 3 => c
And set automatic https redirecting in the virtualhost configuration for all the domains.
Current status:
- a and a1.a are working with https, but a1.a required plugins for redirection from http to https.
- b is working with https
- b subdomains are not working with https, pluggins have led to use *.a certificate which results in security warning for all sites.
- c is working with https.
Can someone please help me understand where can the problem be?
I'm thinking about creating a virtual host configuration for each subdomain in b, but it will be more like a patch than a fix.
I have set up a Wordpress Multisite with LAMP successfully and it currently has the following structure
- a (wordpress primary domain)
- a1.a
- b
- b1.b
- b2.b
- b3.b
- c
I created virtual hosts configurations for the three domains mapping to the same WordPress Multisite directory, and I am running the WordPress MU Domain Mapping plugging to handle redirections and so far has been working great with http.
Then I created the certificates for https:
- cert 1 => a, *.a
- cert 2 => b, *.b
- cert 3 => c
And set automatic https redirecting in the virtualhost configuration for all the domains.
Current status:
- a and a1.a are working with https, but a1.a required plugins for redirection from http to https.
- b is working with https
- b subdomains are not working with https, pluggins have led to use *.a certificate which results in security warning for all sites.
- c is working with https.
Can someone please help me understand where can the problem be?
I'm thinking about creating a virtual host configuration for each subdomain in b, but it will be more like a patch than a fix.
Share Improve this question asked May 11, 2019 at 13:56 Byron QuezadaByron Quezada 11 bronze badge1 Answer
Reset to default 0It seems that I was getting wrong the virtual host configuration file to redirect all http requests to https
This is my current working configuration:
/etc/apache2/sites-available/a.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName a
ServerAlias *.a
DocumentRoot /var/www/a/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =a1.a [OR]
RewriteCond %{SERVER_NAME} =a
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
/etc/apache2/sites-available/a-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName a
ServerAlias *.a
DocumentRoot /var/www/a/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/a/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/a/privkey.pem
</VirtualHost>
</IfModule>
However it is required to update the virtual host configuration RewriteCond %{SERVER_NAME} =a1.a [OR]
for every subdomain I need, therefore the process is not automated.