controller as a subdomain |
[eluser]x386[/eluser]
Is this possible to access controllers not only by site.com/controller and have something like this: controller.site.com? Thanks!
[eluser]x386[/eluser]
This is about redirecting user. I hate redirecting! Though, in the CPanel I have options for it. Anyway to access controller without redirecting via subdoamin? like: controller.domain.com will be same as domain.com/controller Thanks!
[eluser]Colin Williams[/eluser]
I would use mod_rewrite rules to the effect of (.*).domain.com/(.*) index.php/$1/$2
[eluser]x386[/eluser]
Thanks Colin! What is this mod_rewrite and how to implement it? I googled it, but I didn't find anything interesting...
[eluser]Colin Williams[/eluser]
It's an Apache module that lets you rewrite URI requests. I'm not sure what Google you used ![]()
[eluser]Colin Williams[/eluser]
Also, the Router class is the ultimate controller in CI, so you could overload one or some of it's methods in your own MY_Router.php library and sniff out the subdomain before validating and routing the request
[eluser]John_Betong[/eluser]
[quote author="x386" date="1224079576"]Is this possible to access controllers not only by site.com/controller and have something like this: controller.site.com? Thanks![/quote] I use a sub-domain on this site http://iching.justjoolz.com and for me ![]() In my http://localhost I have a path to c:/www/iching/index.php and online I have http://iching.justjoolz.com/index.php index.php - common to both sites Code: ... Needless to say my config.php was setup with trial and error, if you want a copy let me know. |
Welcome Guest, Not a member yet? Register Sign In |