Bonjour.

Je cherche à rediriger une adresse de ce style https://www.sous-domaine.domaine.fr vers https://sous-domaine.domaine.fr

Mais il faut aussi que si je tape http://sous-domaine.domaine.fr cela redirige vers https://sous-domaine.domaine.fr

Si je tape juste www.sous-domaine.domaine.fr cela redirige bien vers https://sous-domaine.domaine.fr

Pour résumer:

https://www.sous-domaine.domaine.fr -> https://sous-domaine.domaine.fr
http://www.sous-domaine.domaine.fr -> https://sous-domaine.domaine.fr
http://sous-domaine.domaine.fr -> https://sous-domaine.domaine.fr

Actuellement j'ai ça dans mon htaccess mais ça ne fonctionne pas totalement

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
RewriteEngine On
RewriteCond %{HTTP_HOST} https://www.sous-domaine.domaine.fr
RewriteRule (.*) https://sous-domaine.domaine.fr/$1 [QSA,L,R=301]
 
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://sous-domaine.domaine.fr/$1 [R,L]
Merci par avance