CodeIgniter Forums
How to setup multi site that will use sub domains in the live server/web server like bluehost - 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: How to setup multi site that will use sub domains in the live server/web server like bluehost (/showthread.php?tid=54760)



How to setup multi site that will use sub domains in the live server/web server like bluehost - El Forum - 09-24-2012

[eluser]rei[/eluser]
I have setup a multisite w/c consists of 3 sites. I can access them using this links:

http://localhost/MultiSiteCI/application_site1/

http://localhost/MultiSiteCI/application_site2/

http://localhost/MultiSiteCI/application_site3/

----------------------------------------------

My question is, how can I make the url to be like this:

application_site1 - main site

application_site2.application_site1 - sub site

application_site3.application_site1 - another sub site


a more real world example of the url would be:

facebook.com - main site
blog.facebook.com - sub site
apps.facebook.com - another sub site

--------------------------------------------------

Can someone please teach me how can I do that in the live server/web server like bluehost?

Thanks in advance Smile


How to setup multi site that will use sub domains in the live server/web server like bluehost - El Forum - 09-24-2012

[eluser]cotsweb[/eluser]
You should be able to use Cpanel to set up subdomains (I don't use Bluehost but I believe they offer cpanel).

Code:
application_site1 - main site

application_site2.application_site1 - sub site

application_site3.application_site1 - another sub site

The subdomains for application_site2 and application_site3 will point to subdirectories under the main site.
application_site2.application_site1 and application_site1/application_site2 will point to the same place but having the subdomain set up means that vistors will be able to go directly to where you want them.

Hope this helps


How to setup multi site that will use sub domains in the live server/web server like bluehost - El Forum - 09-24-2012

[eluser]rei[/eluser]
Thank you so much! It makes sense now. But when I go to my subdomain - http://www.app2.makingfriends.elementfx.com/

It says - Directory access is forbidden.

How can I fix that? hmmm.




How to setup multi site that will use sub domains in the live server/web server like bluehost - El Forum - 09-24-2012

[eluser]cotsweb[/eluser]
Do you have a .htaccess file which is restricting access?
Either in the sub-directory being accessed or in the site root (which would apply to sub-directories)


How to setup multi site that will use sub domains in the live server/web server like bluehost - El Forum - 09-24-2012

[eluser]rei[/eluser]
At first I have a .htaccess file in the sub directory which my sub domain points to. I removed it because it is denying access when I'm on my localhost. After removing it, it worked then I uploaded the site to a web host and created a subdomain. When I'm on the main site it works and if I set the sub domain as the default app in the CI root index.php ( $application_folder = '../app2'; ) it works. But if I set the main site to be the default app, when I access the sub domain it dont work. It always says Directory access is forbidden.


How to setup multi site that will use sub domains in the live server/web server like bluehost - El Forum - 09-24-2012

[eluser]rei[/eluser]
I tried uploading the multi site to another web host. It worked! The problem is in the 1st web host where I uploaded the multi site. Maybe some permission issues or something but I set the permissions to 777. Dont know whats causing the problem. Maybe ill just send a support ticket in that web host. Nwei thanks for your help Smile