Mike G
Mike G

Reputation: 758

In Symfony, how can I require http in a dev environment and https in production?

In production, I have a group of routes that require SSL however this shouldn't be a requirement for development.

I thought that I could simply override my routes in routing_dev.yml but that doesn't seem to work. When navigating to any route, it forces https.

My Setup:

I expected that the routes in routing_dev.yml would have preceded those in the bundle and would have been the ones used while in development.

Am I on the right path, or is there a better way of accomplishing http in development and https in production for a select group of routes?

Upvotes: 3

Views: 1463

Answers (1)

Michael Sivolobov
Michael Sivolobov

Reputation: 13340

You need to use src/FOO/FOOBarBundle/Resources/config/routing_dev.yml for dev-environment (import it in app/config/routing_dev.yml instead of importing src/FOO/FOOBarBundle/Resources/config/routing.yml)

Upvotes: 1

Related Questions