Solved

Multiple CodeIgniter websites within a single domain

Posted on 2014-03-19
2
1,827 Views
Last Modified: 2014-04-06
I am using CodeIgniter framework and I am wondering whether it is possible for me to setup multiple websites within a single domain.  For example, is it possible to achieve something like this:

http://test1.mydomain.com
http://test2.mydomain.com
http://test3.mydomain.com

I would like to have three separate CodeIgniter installations, each operating independently within these three sites, test1, test2 and test3.  Is this possible?  How can I achieve this?

Thanks.
0
Comment
Question by:DanielAttard
2 Comments
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39940140
Yes it's possible.

If all three subdomains are served from the same shared hosting and each subdomain points to a different folder, then you can put the codeigniter 'system' folder 1 level up from public_html and then have a separate application folder for each sub-domain - again 1 level up from public_html. Each sub domain folder would then just contain an index.php file along with the relevant public-facing bits, such as css, images, js etc. Your folder structure may look something like

/system
/app1
/app2
/app3
/public_html
   /app1_folder
      index.php
      /css
      /js
   /app2_folder
      index.php
      /css
      /js
   /app3_folder
      index.php
      /css
      /js


You'd need to edit each index.php to point to the system folder and relevant application folder, and edit the config.php file in each application folder.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39940385
No points for this, please, but beware of links that say www.mydomain.com because you will need those to be redirected.  Relative links will probably be OK.  Explicit links to mydomain.com will need to be redirected, too.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question