Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter with multiple subdomains
#3

(This post was last modified: 01-09-2018, 09:30 AM by ciadmin.)

(01-01-2018, 11:09 PM)Thanks for your reply,In database I have a separate field for each country to get data for specific country. I understand the routing modification. you are getting the host and then split it by fining "." in the name of the host and the results stored in an array. so at the 0 index of the array you have sub-domain name. But I\m confused about how to upload application on server. for each sub-domain I need to upload this application. Infect I Wrote:
As per your requirement you need to added a unique field for subdomain. And another option for you, you can make multiple tables as per subdomain for manage the content as per subdomain.

That said my solution, for those who may stumble across it is, in the routes.php I ended up making a small function to get the HTTP_HOST split it up based on . and use it from there to my needs. My example is as follows.

Mind you I also replaced everything in the routes.php so its not just a straight line of $route['this/that'] = 'dir/controller';

[code redacted]
Reply


Messages In This Thread
RE: CodeIgniter with multiple subdomains - by waqaskhanbhatti - 01-01-2018, 11:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB