Поэтому я пытаюсь перенаправить все запросы www на без www, а также https с DNS и конфигурацией vhost apache2.
Код: Выделить всё
my-example-domain.com => https://my-example-domain.com
www.my-example-domain.com => https://my-example-domain.com
http://my-example-domain.com => https://my-example-domain.com
http://www.my-example-domain.com => https://my-example-domain.com
Запись: my-example-domain.com => {serverIp
Перенаправление HTTP: www.my-example-domain.com => https://my-example-domain.com
конфигурация vHost ( объединил некоторые ответы, которые я нашел):
Код: Выделить всё
ServerName my-example-domain.com
ServerAlias www.my-example-domain.com
Redirect permanent / https://my-example-domain.com/
ServerName www.my-example-domain.com
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/my-example-domain.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my-example-domain.com-0001/privkey.pem
Redirect permanent / https://my-example-domain.com/
ServerName my-example-domain.com
DocumentRoot /var/www/my-example-domain.com
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/my-example-domain.com-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my-example-domain.com-0001/privkey.pem
Options +ExecCGI
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Код: Выделить всё
sudo certbot certonly --dns-dnsmadeeasy --dns-dnsmadeeasy-credentials ~/.secrets/certbot/dnsmadeeasy.ini -d my-example-domain.com -d www.my-example-domain.com
Теперь проблема в том, что когда я пытаюсь посетить https://www.my-example-domain.com, я получаю предупреждение SSL все браузеры, поскольку сертификат здесь является подстановочным знаком dnsmadeeasy.

Я связался с ними, и они прислали мне довольно запутанное электронное письмо с сообщением о том, что у них есть серверная часть, которая обрабатывает перенаправления, и единственное решение с их стороны - это установить мой сертификат в их систему. Они тоже это говорили;
Код: Выделить всё
It is most common within the industry to simply configure any URL redirections that you require on your own web application systems so that you may control SSL certificate management and other configuration parameters associated with your webserver. Our HTTP redirection records simply exist for the option to configure a URL redirection through your DNS provider.
Подробнее здесь: https://stackoverflow.com/questions/787 ... -via-https