I am trying to get a secure url like this:
$this->storeManager->getStore()->getUrl('someurl', ['_secure' => 'true']);
I still get an insecure url with
What am I doing wrong?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
_secure only works if the URL natively supports HTTPS.
In case it does not (which seems to be your case as your code is totally valid) you can force it using
$this->storeManager->getStore()->getUrl('someurl', ['_secure' => true, '_forced_secure' => true]);
Also you were casting
true to a string
'true' I'm not sure if it's the reason but I changed that in the code I posted.