Closed
Description
I am defining a named route inside config/routes.php
. I want to force that route to be HTTP, not HTTPs.
The _https
flag, listed under Reserved Route Elements, is what I'm looking for. And because that section is under Connecting Routes (see Page Contents), that kind of implies I can use these Reserved Route Elements when connecting my routes.
What I did
// config/routes.php
$routes->connect(
'/example',
[
'controller' => 'Articles',
'action' => 'example',
],
[
'_name' => 'example',
'_host' => 'example.com',
// tried everything, including the legacy `_ssl`
'_https' => false,
'_ssl' => false,
'_scheme' => 'http',
]
);
// elsewhere
echo Router::url(['_name' => 'example']);