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
Change your app.php last lines like this:
if ($request->getScheme() === 'http') {
$urlRedirect = str_replace($request->getScheme(), 'https', $request->getUri());
$response = new RedirectResponse($urlRedirect);
} else {
$response = $kernel->handle($request);
}
$response->send();
$kernel->terminate($request, $response);