I would like to make a redirection to https://www.
Which means that:
http:// --> https://www.
http://www. --> https://www.
https:// --> https://www.
https://www. --> no redirection
I tried plenty of things but never reached that goal.
my current .htacces
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ web/$1 [QSA,L]
</IfModule>
But the problem is that it doesn't redirect to www
. So I tried to put that before :
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ www.%{HTTP_HOST}/$1 [R=301,L]
But that made a redirection curl so shut my site down.
PS: I'm on symfony
Does someone have the magic solution ? Thank's !