@herminia_bruen
To force HTTPS and www on Symfony 4, you can follow the steps below:
1 2 3 |
RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
1 2 |
RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
By following these steps, all requests to your Symfony 4 application without HTTPS or without www will be redirected to the secure version with www.