• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Codeigniter subdomains

#1
[eluser]Citizen[/eluser]
Lets say I have my controllers organized as such:

/news/main.php
/news/recent.php
/business/main.php
/business/recent.php

How can I get news.domain.com to load the main.php controller from my /news/ controller directory?
And then news.domain.com/recent would load /news/recent.php controller

#2
[eluser]ranjudsokomora[/eluser]
Hello Citizen,
You would need to modify the router class.
I'll see if I can write an example of what you are looking for. I'll post it here in a couple of hours.

#3
[eluser]Citizen[/eluser]
[quote author="ranjudsokomora" date="1310527443"]Hello Citizen,
You would need to modify the router class.
I'll see if I can write an example of what you are looking for. I'll post it here in a couple of hours.[/quote]
Thanks, any help would be appreciated.

#4
[eluser]Aken[/eluser]
Redacted. See below.

#5
[eluser]Citizen[/eluser]
[quote author="Aken" date="1310824675"]Don't even need to mess with routes - a correctly-configured .htaccess file would do the trick.[/quote]

How would I do that without having to have a rule for every page within the subdirectory?

#6
[eluser]Aken[/eluser]
My mistake - this would be better suited with DNS. See: http://stackoverflow.com/questions/58612...access-php

#7
[eluser]Citizen[/eluser]
Thanks, guys, but I'm still not sure what to do.

If it helps: I have a finite list of subdirectories that I want to use, only about 5 or so. I'm not looking to create a wildcard subdomain catcher.

And I'm aware of how to create subdirectories through DNS or with htaccess, but I'm not sure what the best practice would be for codeigniter. I'm hoping someone can tell me what the best way to do this with codeigniter.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.