I run a server that supplies hosting for about 20 wordpress sites. I decided that it was better to issue a certificate for each site.
Then to control the site through their separate virtual host configurations
This is my virtualhost conf file … as you see I do my rewrite rules inside the apache file rather than a htaccess file. I found I needed this line in the ssl conf for the site to stop getting SNI errors SSLStrictSNIVHostCheck off.
There are very few browsers around without SNI support today.
<VirtualHost *:80>
UseCanonicalName Off
ServerAdmin admin@example.org
ServerAlias www.example.org
ServerName example.org
#If you want to force https remove the hash from the following line
Redirect permanent / https://example.org
VirtualDocumentRoot /var/www/html/example.org/
DirectoryIndex index.php
Options All
RewriteEngine On
RewriteRule ^/wp-admin/$ /wp-admin/index\.php [R=301,L]
RewriteRule ^/uploads/(.*)$ /var/www/html/example.org/wp-content/uploads/$1 [L,NC]
RewriteRule ^/wp-content/uploads/(.*)$ /var/www/html/example.org/wp-content/uploads/$1 [L]
RewriteRule ^/wp-content/(.*)$ /var/www/html/example.org/wp-content/$1
RewriteRule ^index\.php$ - [L]
For permalinks to work
RewriteCond /var/www/html/example.org/%{REQUEST_URI} !-f
RewriteCond /var/www/html/example.org/%{REQUEST_URI} !-d
RewriteRule . /var/www/html/example.org/index.php [L]
#In case permalinks dont work … according to Debian Wiki
Options FollowSymLinks
AllowOverride All
Require all granted
#CustomLog /var/log/apache2/access.log vhost_combined
#Switch these on and turn the above setting off if there are problems
CustomLog /var/log/apache2/example.org-access.log common
ErrorLog /var/log/apache2/example.org-error.log
this is needed when activating multisite, WP needs to to a
that apache is correctly configured
php_admin_flag allow_url_fopen on
<VirtualHost *:443>
UseCanonicalName Off
ServerAdmin admin@example.org
ServerAlias www.example.org
ServerName example.org
SSLEngine On
SSLCertificateFile /etc/letsencrypt/live/example.org/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/live/example.org/fullchain.pem
SSLStrictSNIVHostCheck off
VirtualDocumentRoot /var/www/html/example.org/
DirectoryIndex index.php
Options All
RewriteEngine On
RewriteRule ^/wp-admin/$ /wp-admin/index\.php [R=301,L]
RewriteRule ^/uploads/(.*)$ /var/www/html/example.org/wp-content/uploads/$1 [L,NC]
RewriteRule ^/wp-content/uploads/(.*)$ /var/www/html/example.org/wp-content/uploads/$1 [L]
RewriteRule ^/wp-content/(.*)$ /var/www/html/example.org/wp-content/$1
RewriteRule ^index\.php$ - [L]
For permalinks to work
RewriteCond /var/www/html/example.org/%{REQUEST_URI} !-f
RewriteCond /var/www/html/example.org/%{REQUEST_URI} !-d
RewriteRule . /var/www/html/example.org/index.php [L]
#In case permalinks dont work … according to Debian Wiki
Options FollowSymLinks
AllowOverride All
Require all granted
#CustomLog /var/log/apache2/access.log vhost_combined
##In case of problems use the following logs instead
CustomLog /var/log/apache2/example.org-access.log common
ErrorLog /var/log/apache2/example.org-error.log
this is needed when activating multisite, WP needs to to a
that apache is correctly configured
#php_admin_flag allow_url_fopen on