• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2270
  • Last Modified:

Multiple CodeIgniter websites within a single domain

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:


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?

1 Solution
Chris StanyonCommented:
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


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.
Ray PaseurCommented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now