Redirection sous-domaine en HTTPS
Bonjour,
Je me tourne vers vous car je reste bloqué sur un problème de redirection.
J'ai mon domaine qui a une petite partie (sub1) et le reste (le www). En http, je n'avais pas de soucis, mais je viens de mettre les certificats et le sub1 est inaccessible.
J'ai donc mon fichier de conf pour le http de mon domaine domaine.fr.conf :
Code:
1 2 3 4 5 6 7 8 9
| <VirtualHost *:80>
ServerName domaine.fr
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(.+\.)?domaine\.fr$
RewriteRule ^(.*)$ https://%1domaine.fr/$1 [R,L]
</IfModule>
</VirtualHost> |
et mes fichiers de conf pour le httpS :
1- 000-domaine.fr.conf :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <VirtualHost *.443>
ServerAdmin contact@domaine.fr
ServerName sub1.domaine.fr
DocumentRoot /home/www/domaine.fr/sub1
<Directory /home/www/domaine.fr/sub1>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /home/www/domaine.fr/log/error.sub1_apache.log
LogLevel warn
CustomLog /home/www/domaine.fr/log/access.sub1_apache.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/sub1.domaine.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/sub1.domaine.fr/privkey.pem
</VirtualHost> |
2- 111-domaine.fr.conf :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <VirtualHost *:443>
ServerAdmin contact@domaine.fr
ServerName www.domaine.fr
ServerAlias *.domaine.fr
DocumentRoot /home/www/domaine.fr/www
<Directory /home/www/domaine.fr/www>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /home/www/domaine.fr/log/error_apache.log
LogLevel warn
CustomLog /home/www/domaine.fr/log/access_apache.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domaine.fr/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domaine.fr/privkey.pem
</VirtualHost> |
Merci d'avance
Bonne journée