CodeIgniter Forums
Loading Different controllers - 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: Loading Different controllers (/showthread.php?tid=28502)



Loading Different controllers - El Forum - 03-12-2010

[eluser]Shouvik-S-Mazumdar[/eluser]
Hi ,

I have a website structure like this


controllers/
mydir/
adir/

lets say the user requests

http://www.example.com/somecontroller

i want him to get redirected ( with or without url modification in the browser )

to http://www.example.com/mydir/somecontroller

and if he specifies


http://example.com/adir/somecontroller - it should behave normally meaning he should get what he wanted under adir ( not redirect to mydir since he specified the dir name)


Also, is it possible to virtualize the subdiretory like http://adir.example.com ?

i have been thru the threads for virtual sub domain ..couldnt solve the problem so thot of reasking it here


Loading Different controllers - El Forum - 03-13-2010

[eluser]mohsin917[/eluser]
To access the controllers from a specific directory change the application folder in your index.php file at the root

Code:
$application_folder = "application/users";

It will access the the controller from users directory.

http://localhost/ursite/controller_name


and you don't have to use this url

http://localhost/ursite/users/controller_name