Want to develop a new homepage and visit it by www.abc.com/the-new-homepage. So, I want www.abc.com to redirect to www.abc.com/the-new-homepage.
I’m not getting the expected result yet, I’m trying get things clear on my testbed, tried several options, but I can’t get it right. It looks a bit like https://discourse.cakephp.org/t/pagescontroller-ignores-pages-dir/5087 to me?
The homepage shows up when not routed:
The only thing what wonders here is I left out the ‘display’, but the page shows up anyway, expected something like a missing method.
<?= $this->Html->link(__('homepage'), ['controller' => 'pages', 'action' => 'myhomepage']) ?>
Setting up the routes for groups and individuals don’t give any problems as expected, the route to the page does.
$routes->connect('/the-new-homepage',['controller' => 'Pages', 'action' => 'myhomepage']);
$routes->connect('/all-groups', ['controller' => 'Groups', 'action' => 'index']);
$routes->connect('/all-individuals', ['controller' => 'Individuals', 'action' => 'index']);
The route looks like I want to have it:
but it now I get an unexpected missing method:
Thought maybe getting the ’ display’ into place would help, but it didn’t:
<?= $this->Html->link(__('homepage'), ['controller' => 'pages', 'action' => 'display', 'myhomepage']) ?>
$routes->connect('/the-new-homepage',['controller' => 'Pages', 'action' => 'display', 'myhomepage']);
Route isn’t ‘active’, homepage shows up but with /pages/myhomepage adress.
Hope someone get things clear to me.