I have a symfony2 application.
On the prod server I want all my routes to go via https, while in dev I want to be able to use http. How do I achieve that with symfony2 a
You can define parameter for that. In app/config/config.yml
define:
parameters:
httpProtocol: http
Then in app/config/config_prod.yml
:
parameters:
httpProtocol: https
And in routing.yml
change to:
myBundle:
resource: "@MyBundle/Controller/"
type: annotation
prefix: /
schemes: ['%httpProtocol%']
Clear the cache (both prod and dev) and it should work.