Welcome Guest, Not a member yet? Register   Sign In
hao can i routing subdomain?
#6

(09-23-2015, 05:19 AM)Narf Wrote:
(09-23-2015, 05:13 AM)Martin7483 Wrote:
(09-23-2015, 05:00 AM)Narf Wrote: Some things are simpler than they seem ...



Code:
// application/config/routes.php
switch ($_SERVER['HTTP_HOST'])
{
   case 'sub.domain.tld':
       // your sub.domain.tld routes here
       break;
   case 'default.domain.tld':
   default:
       // your default domain routes here
       break;
}

Wouldn't this only work if your subdomain is pointing to the same root directory as your main domain?

Yes, but how else do you expect to be able to have domain-based routing within CI?

I was asking because a subdomain by default points to it's own directory in the root of your hosting
Reply


Messages In This Thread
hao can i routing subdomain? - by Aloghli - 09-21-2015, 10:57 PM
RE: hao can i routing subdomain? - by Muzikant - 09-22-2015, 04:07 AM
RE: hao can i routing subdomain? - by Narf - 09-23-2015, 05:00 AM
RE: hao can i routing subdomain? - by Aloghli - 09-30-2015, 04:25 AM
RE: hao can i routing subdomain? - by Martin7483 - 09-23-2015, 05:13 AM
RE: hao can i routing subdomain? - by Narf - 09-23-2015, 05:19 AM
RE: hao can i routing subdomain? - by Martin7483 - 09-23-2015, 05:24 AM
RE: hao can i routing subdomain? - by mwhitney - 09-23-2015, 08:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB