Welcome Guest, Not a member yet? Register   Sign In
subdomains
#1

[eluser]trumnation[/eluser]
I have a website broken down into groups of members, and I want each group to have its own subdomain. How can I point each subdomain to each group?
#2

[eluser]Michael;[/eluser]
Greetings...

Each subdomain is a folder in your webroot, i.e.:

public_html
->subdomain1
->subdomain2

So, all you have to do is make each subdomain it's own application.

What I have done with CI is sperate it out so that the system folder is outside the webroot, then each domain/subdomain is in it's own folder, like so:

system
public_ftp
public_html
->default //this is the main domain
->subdomain1
->subdomain2
index.php //this is the index that points to 'default'
subdomain1.php //points to subdomain1 application
subdomain2.php //points to subdomain2 application

With this setup you can easily segregate your member groups so that each have their own subdomain and CI application. Each subdomain will have it's own index.php so if you go to subdomain1.example.com you'll hit the subdomain1 folder and it will run as it's own application... or, if you are surfing the "main" default site you would be able to have link such as example.com/subdomain1.php/controller/method ... etc to lead them to the group application.

Hope this helps, good luck.
#3

[eluser]trumnation[/eluser]
ok that is probably the way I will go, although, there is no way you could just use the subdomain as a variable, rather than having to copy the group script to each subdomain?
#4

[eluser]Michael;[/eluser]
Why do that? Instead I would have a group field in their member record and then use that to "point" them to the correct group spot. I would think the subdomain idea is overkill then.
#5

[eluser]trumnation[/eluser]
I want to do it that way mainly for an easy url for the members to remember, easy for search engines and to keep the urls short. Kind of same as the reason/way facebook uses them. Upon thinking about it, your last post might be a good way to do it, and keep the load off of the main application.
#6

[eluser]tinawina[/eluser]
Hey - just wanted to say thanks for posting this. I have been using CI for about 8 or 9 months and built a site using the framework. I installed everything in my web root. Now I find that I have a need to create sub-domains, many of which will use CI. I just downloaded 1.6.1 and installed it as you suggested - works great. So - thanks! And wondering if this structure for the initial set-up should be added to the wiki? Or even as part of the user guide, eg., "alternative installations" -- just seems like this would be very useful to people, esp. first time implementers.




Theme © iAndrew 2016 - Forum software by © MyBB