CodeIgniter Forums
Subdomain as a segment/controller? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Subdomain as a segment/controller? (/showthread.php?tid=49704)



Subdomain as a segment/controller? - El Forum - 02-29-2012

[eluser]talkingnews[/eluser]
I need to use a subdomain as a class. ie, instead of:

www.example.com/class/function/ID
(www.localguide.com/town-name/history/1)

I need

class.example.com/function/ID
(town-name.localguide.com/history/1)

I've wildcarded the subdomain in nginx, now I've googled and read
http://ellislab.com/codeigniter/user-guide/libraries/uri.html
http://ellislab.com/codeigniter/user-guide/general/urls.html
http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html
but nothing. I need it to be so that if another town is added to the db, it'll resolve that new town and its details.

I've had it going fine in plain old php for a couple of years now; now I want to upgrade to codeigniter without ruining my old structure if possible (plus there's a good reason for it).

Thanks!