Solved

Multiple CodeIgniter websites within a single domain

Posted on 2014-03-19
2
1,781 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!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
show form submit button based on jquery sum 5 30
google analytics in wordpress 4 35
what are list of ebay api errors 1 19
two ways encryption with php 3 28
This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
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…
The viewer will learn how to count occurrences of each item in an array.

809 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