I'm having problems with my routing on a new website I'm setting up. Having been going round and round in circles, I believe what is happening is that on the shared hosting, all routes get directed to the 'index' action of the relevant controller (it's fine on my localhost).
Having already had problems with the hosting people (suhosin blocking the composer.phar update, and Apache environment variables not being passed to PHP), I suspect the hosting config, but I've no idea how to go about debugging the routing - have you any suggestions?
Oooh, this was a tricky one – a bit of distance and a fresh approach helped, together with Debug::dump(Uri::main(), Uri::current()) in the 404 controller.
To enable hyphens in URLs, my config 'security' array includes
'uri_filter' => array(
'htmlentities',
// enable hyphens in URLs: stackoverflow.com/questions/11652447
On my localhost (and other servers) the $uri parameter includes a leading '/'; but on the shared hosting I'm using for the current project, it does not; this meant that the first letter of the URI got capitalised by the call to ucwords(), hence breaking the routing. I've fixed it with a call to lcfirst().
I have no idea why that would have enabled it to route to the 'index' action (that was clearly something of a red herring), but do you have any idea why the $uri parameter might vary on different servers (with or without leading '/'), Harro?