CodeIgniter Forums
Routing issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Routing issue (/thread-49907.html)



Routing issue - El Forum - 03-06-2012

[eluser]Unknown[/eluser]
Hi All,
i am developing one application

where their will be two site
one

http://localhost/ci-acme/

and one admin section

http://localhost/ci-acme/__admin__


i am planning for dynamic page for normal section therefore i have changed the route.php

$route['(:any)'] = "maincms";

but now admin section is not opening.

than i changed this setting

$route['__admin__/news'] = "__admin__/news";

than this is coming
http://localhost/ci-acme/__admin__
but
this is not coming
http://localhost/ci-acme/__admin__/content

please suggest the way.

Regards
Anil



Routing issue - El Forum - 03-08-2012

[eluser]Kristories[/eluser]
Try this..
Code:
$admin       = 'custom_admin';
$route[$admin]      = 'home/admin';
$route[$admin.'/([a-zA-Z0-9]+)']   = '$1/admin/index';
$route[$admin.'/([a-zA-Z0-9]+)/(:any)']  = '$1/admin/$2';
$route[$admin.'/login']    = 'auth/admin/login';
$route[$admin.'/logout']    = 'auth/admin/logout';

Just call http://yours.com/custom_admin/controller/method

I hope this help you..