Is there an easy way to create subdomains on codeigniter like api.site.com?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The approach you take depends on how different the subdomain is from the main site. If they are very similar and will be using the same codebase:
If you need some settings to be different on a different subdomain, you could create a config file like so:
Another approach would include setting up a separate application folder for the subdomain, but pointing at the same system folder. If you organize your filesystem like this:
You could then point the index.php file in each htdocs folder at the common/system directory. You could also put code you want to share between all subdomains in common/application and include them from your code.