We have a Symfony 1.4 project and we are trying to force https for all pages in a symfony application to use only the htaccess file. I know there are ways to do this with filters, but I want to know if this can be done without it?
Here is the .HTACCESS file that I am currently using, but does not work as expected ...
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
I also tried without success:
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
I am sure there are some quirks that I am missing in this with Symfony, as it is an easy task to do it right now. Any ideas?
source
share