Answer the question
In order to leave comments, you need to log in
How can I create a site.ru to open at the request of city.site.ru?
How can I create a city.sayt.ru with a certificate already received from "Let's Encrypt", but with the data from the site site.ru?
I make
city.site.ru.
CNAME site.ru.
site.ru is displayed, in the address bar city.site.ru - everything is as it should, but the certificate from site.ru is pulled up and does not fit city.site.ru.
If I make a redirect through htaccess, then the site.ru domain will already be in the address bar
Answer the question
In order to leave comments, you need to log in
Option a) as Ruslan wrote, you need a wildcard certificate that will be valid for "site.ru" and "*.site.ru"
Option b) set up city.site.ru physically on the same path as site.ru, but in the web server settings you connect different certificates for each domain
. Example:
SSLEngine on
SSLStrictSNIVHostCheck on
SSLProtocol -ALL +SSLv3 +TLSv1
SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:-MEDIUM
<VirtualHost *:80>
DocumentRoot "/var/websiteexample/public/www"
ServerName www.site.ru
ServerAlias site.ru
<Directory "/var/websiteexample/public/www">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/websiteexample/public/www"
ServerName www.site.ru
ServerAlias site.ru
#You might also need: SSLCertificateChainFile
SSLCertificateFile /root/www.site.ru.crt
SSLCertificateKeyFile /root/www.site.ru.key
<Directory "/var/websiteexample/public/www">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/var/websiteexample/public/www"
ServerName moscow.site.ru
SSLCertificateFile /root/moscow.site.ru.pem
SSLCertificateKeyFile /root/moscow.site.ru.key
<Directory "/var/websiteexample/public/www">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
Get a certificate in LE for two of these domains at once, or two separate ones and proxy at the web server level.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question