As is usual with Codeigniter, assuming I have $route['default_controller'] = "welcome";
, if I request the url on the left, I am using the controllers listed on the right:
www.foo.com/ => applications/controllers/welcome.php with method "index"
www.foo.com/bar => applications/controllers/bar.php with method "index"
www.foo.com/bar/baz => applications/controllers/bar.php with method "baz"
This is all as expected. But when a subdomain is used, I would like to have codeigniter use controllers in a subdirectory with the same name as the subdomain:
abc.foo.com/ => app/controllers/abc/welcome.php with method "index"
abc.foo.com/baz => app/controllers/abc/baz.php with method "index"
abc.foo.com/baz/qux => app/controllers/abc/baz.php with method "qux"
Can this be done with routes? If so, how do you set routes based on subdomain?
Or is there a simpler way to do this?