I want to generate URL with https://
as a prefix, using the Twig function url()
. However, the generated URL is always http://
.
I made the setup given here: https://symfony.com/doc/6.2/routing.html#forcing-https-on-generated-urls.
My config/packages/framework.yaml
:
framework:
http_method_override: false
handle_all_throwables: true
...
My config/routes.yaml
:
controllers:
resource:
path: ../src/Controller/
namespace: App\Controller
type: attribute
defaults: [https] // note HTTPS here
I am using the PROD environment.
My .env
file is:
APP_ENV=prod
APP_URL=https://something... // note HTTPS here
Cache has been cleared with prod option.
However, when I use from my twig template:
{{ url('my_route') }}
the generated route is correct but still in http
(and not https
).
Am I missing something ?