Im trying to do something like this .
Basically i want to:
- When you access domain.com it should load: domain.com/frontend
- When you access userlogin.domain.com it should load: domain.com/backend/userlogin
The nettus shows how to this on wamp but using different directories for each case.
For example, if you access domain.com the folder set in apache virtualhosts is: c:/folder_of_frontend, if you access userlogin.domain.com the folder is set to c:/folder_of_backend
I want to use the same CI system and application folder. I’ll instead use different controllers to handle front and backend.
Thanks
You could set a constant determined by $_SERVER[‘HTTP_HOST’] and then switch or set other variables based on the value of the constant.
Elsewhere in your application you can then check for the value of SUBDOMAIN and perform appropriate actions.
//edit.. I’d usually put the above in /index.php but /application/config/constants.php might also be a good place. Think I’ve just picked up a bad habbit there.