?
Solved

Multiple CodeIgniter websites within a single domain

Posted on 2014-03-19
2
Medium Priority
?
2,111 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
Chris Stanyon earned 2000 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 111

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 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