I have a site where users can point their own custom domain to their unique directory on my site through A Records.
For example, example.com
points to mysite.com/something
and anothersite.org
points to mysite.com/somethingelse
Each of these custom domains has an SSL certificate generated for them however is there a way to point to them dynamically in the VirtualHost file?
SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
domain.com
should be the current domain - if someone visits example.com
then that should be where domain.com
is.
Is it possible to use variables somehow?
I have tried this but it doesn't work and causes an error: SSLCertificateFile /etc/letsencrypt/live/%{HTTP_HOST}/fullchain.pem
There is one only virtual host in total as there are hundreds of custom domains.