CodeIgniter Forums
How to config route ?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to config route ?? (/showthread.php?tid=6826)



How to config route ?? - El Forum - 03-12-2008

[eluser]Le Bang[/eluser]
i have two controller: admin.php, root.php.

If accessed into http://mysite.com/index.php/admin then it will call controller admin.php Contrariwise I wish all call diplay uniformization root.php. I have to how to set up route


How to config route ?? - El Forum - 03-13-2008

[eluser]frenzal[/eluser]
$route["admin(.+)"] = "admin$1";
$route[":any"] = "root";

If I've understood you correctly that is. This will route everything starting with admin to the admin controller including admin/blah. All the rest will go to root.


How to config route ?? - El Forum - 03-13-2008

[eluser]Le Bang[/eluser]
Thanks. inaccuracy wherewith of request own.

I want as flowing:

http://mysite.com/index.php/admin/
http://mysite.com/index.php/admin/add/
http://mysite.com/index.php/admin/edit/433/

===> run admin.php controller

else


http://mysite.com/index.php/not_name_admin/
http://mysite.com/index.php/abc/
http://mysite.com/index.php/xyz/

===> run root.php

note: root.php is default controller


How to config route ?? - El Forum - 03-13-2008

[eluser]frenzal[/eluser]
that's what i assumed, i might have made a slight mistake though:

$route["admin(.+)*"] = “admin$1”;
$route[":any"] = “root”;

if the default admin controller doesnt work also add:
$route["admin"] = “admin”;


How to config route ?? - El Forum - 03-13-2008

[eluser]Le Bang[/eluser]
No solution config $route Is to make to get this asteroid ???


How to config route ?? - El Forum - 03-14-2008

[eluser]frenzal[/eluser]
right, now you've lost me


How to config route ?? - El Forum - 03-14-2008

[eluser]Le Bang[/eluser]
Sorry. I speak english very bad. Ought to slander colloq. Wait you sympathetically.

Really I need this circumstance resolving. Due to it concern over come to project strategy of mine.