CodeIgniter Forums
Rootes bug? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Rootes bug? (/showthread.php?tid=67465)



Rootes bug? - Mbvana - 02-24-2017

I have blank app from distribution
I add the second route to Config/Routes.php

$routes->add('/', 'Home::index');   // from distrib
$routes->add('/test', 'Home::index'); // addition

I get 200 OK for 
http://local.dev/
And 404 fof
http://local.dev/test

Why? Sad


RE: Rootes bug? - kilishan - 02-26-2017

Try the second one without the forward slash and tell me if it's working?


RE: Rootes bug? - Mbvana - 02-27-2017

Thank you so much!
All right.

For many years I have not programmed in php.
But now it was necessary. And I'm really looking forward to CI4


RE: Rootes bug? - kilishan - 02-27-2017

So that's working? That shouldn't be a requirement, honestly, so it looks like that needs to be marked as a bug. Smile


RE: Rootes bug? - Mbvana - 02-28-2017

Without a slash at the beginning all right.
$routes->add('/test', 'Home::index'); // 400 OK
$routes->add('test', 'Home::index'); // 200 OK
I do not know whether this is a mistake. But it is illogical IMHO


RE: Rootes bug? - InsiteFX - 03-01-2017

@kilishan, I thought that the / slash meant that it was the root directory and that sub-directories did not require it?


RE: Rootes bug? - kilishan - 03-01-2017

@insite - well, we're dealing with URI's at this point, not directories, though they do match up. The point is that it should work with or without the leading slash and it's currently not.


RE: Rootes bug? - InsiteFX - 03-02-2017

(03-01-2017, 11:51 AM)kilishan Wrote: @insite - well, we're dealing with URI's at this point, not directories, though they do match up. The point is that it should work with or without the leading slash and it's currently not.

OK, thanks for the clarification.