Bonjour,
J'ai de nombreux sites hébergés sur une machine.
J'aimerai rediriger un seul nom de domaine "site-internet.com" vers sa configuration ssl.

Voici ce que je cherche a faire :
  • www.site-internet.com => https://www.site-internet.com
  • site-internet.com => https://www.site-internet.com
  • test.site-internet.com => http(s)://test.site-internet.com



Voici mon fichier conf apache :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
NameVirtualHost *:80
 
<VirtualHost *:80>
        RewriteEngine on
 
        RewriteCond %{HTTP_HOST} ^test.site-internet\.com$[NC]
        RewriteCond %{HTTPS} off
        RewriteRule ^(.*)$ https://test.site-internet.com/$1 [NC,R=301,L]
 
        RewriteCond %{HTTP_HOST} ^(.*)\.site-internet\.com$
        RewriteCond %{HTTP_HOST} ^site-internet\.com$
        RewriteCond %{HTTPS} off
        RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301]
</VirtualHost>
Dans cette configuration TOUT ce qui contient "site-internet" est redirigé vers "https://www.site-internet.com". Je n'arrive pas à accéder à "http://test.site-internet.com".
Pour le reste des noms de domaines, tout est ok.

Merci de votre aide...