CodeIgniter Forums
URI routing with subdirectory - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: URI routing with subdirectory (/thread-1914.html)



URI routing with subdirectory - El Forum - 07-04-2007

[eluser]Lark[/eluser]
I've found a weird error while working with URI-routing. Maybe the problem has something to do with my use of subdirectories.

I want to route a ID to a class without defining any method. The class is in a subdirectory.

Code:
$route["subdir/myclass/(\d+)"] = "subdir/myclass/index/$1";

Now I can't receive the ID in my index method.

Code:
function index($id = 0)
    {
            echo $id;
    }

But the funny thing is that if I rewrite the route like this it will work.

Code:
$route["subdir/myclass/(\d+)"] = "subdir/myclass/index/something/$1";

I've added the "something" in the URI.

Is this a bug?


URI routing with subdirectory - El Forum - 07-12-2007

[eluser]Lark[/eluser]
Anyone who can help me with this?


URI routing with subdirectory - El Forum - 07-17-2007

[eluser]Jumper[/eluser]
Unfortunately, I think that $route[..] is not working properly with sub directories.