I'm trying to dynamically read the location of the SSL certificates depending on which url was used to connect to my server. I have attempted a few different ways but none seem to work. Currently I have the config as noted below
UseCanonicalName Off
listen 443
<VirtualHost *:443>
ServerName example
ServerAlias *
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/%0/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/%0/privkey.pem
VirtualDocumentRoot /var/www/vhosts/%-2/%-3+/public
</VirtualHost>
The problem here is that when I start apache I get an error saying it can't find the file location for the ssl certificate stating '/etc/letsencrypt/live/%0/cert.pem'
So it seems the %0 is not being replaced by the url.
Edit: When I replace only %0 by the url manually then said url has working SSL