How to load different content based upon URL used to visit site i CodeIgniter

I'm sure I'm not the first person who has thought about this but I haven't had any luck forming that proper search query in google to find the info. Here's what I'm wanting to do:

I have a CodeIgniter based site. I'm going to store basic content into tables in the db. I'm thinking that I would have the domain names stored in table to and use the unique id of the table row as the method of querying the appropriate content from the db for the rest of the views. For example. MyDomain.com is #1 in the row followed by YourDomain.com. If the visitor arrived at the site by typing YourDomain.com then somehow CI would "see" that and then query the content for that domain from the db.

Does this make sense? Has anyone else tried it? Is it possible?

Answers


Haven't done it myself, but I did some searching for "codeigniter multi site" and found some useful links, this being one of them that seemed to step you through the process.


In general there is an HTTP_HOST header (or similar header) that identifies the host in the user's request. You can look that header up and then use that to index into your database to extract the right content.


Need Your Help

Is it possible to disallow jsp execution on tomcat + apache

java spring apache jsp tomcat

I have an application tomcat + apache + mod_jk + spring mvc deployed on remote server. After making request to the controller I am having jsp source code in the response. It is not related with spr...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.