I actually know how to force redirect to https or to http if its local, like below:
security.yml
...
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: http, host: localhost$ }
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
...
but the problem is that, I have alot of redirections.
Is there easy way to ignore https for localhost? I couldn't find anything on symfony homepage or on google.
or is it something like below possible?
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https, host:!localhost$}
is it possible to ignore host?
try to modify .htaccess file and use server_name to check if localhost:
check example here or here