CodeIgniter Forums
Routing issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Routing issue (/showthread.php?tid=49907)



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..