Welcome Guest, Not a member yet? Register   Sign In
Multiple domains pointing to same CI application
#6

[eluser]Phil Sturgeon[/eluser]
The above methods either do not answer the question or would not work. Routes will not allow you to have multiple sites running on one codebase... well, not by themselves.

The best way to do this is to use Apache proxy which will allow you to stay on your different domains but have a shared single codebase.

You can set up one URL to be the main one. Which will accept parameters like so:

Quote:http://masterdomain.com/controller/metho...location=1

You'll have to work out how to correctly use GET strings mixed with normal params, but that would help out. Or instead of the get parameter, set up a route to use the first CI segment as the location parameter.

Then look at step #1 on my blog post to set up a apache proxy.

You can then do proxy redirects in htaccess or your main httpd.conf file like so:

Quote:RewriteEngine on
RewriteBase /
RewriteRule ^(.*)$ http://masterdomain.com/$1?location=1 [NC,QSA,P]

The flags there are "Non-case Sensitive", Query-String Append and Proxy. This adds the location=1 on the end even if there is already a query string and makes the redirect a hidden one instead of a normal 301 type.

Then you just need to set up either a new htaccess file for each of your domains, or host them all on the same server and modify the httpd.conf for each of your sites (see how to make them virtual hosts in that same blog article).


Messages In This Thread
Multiple domains pointing to same CI application - by El Forum - 12-05-2008, 09:30 PM
Multiple domains pointing to same CI application - by El Forum - 12-07-2008, 09:57 AM
Multiple domains pointing to same CI application - by El Forum - 12-07-2008, 10:15 AM
Multiple domains pointing to same CI application - by El Forum - 12-07-2008, 11:00 AM
Multiple domains pointing to same CI application - by El Forum - 12-07-2008, 03:56 PM
Multiple domains pointing to same CI application - by El Forum - 12-08-2008, 06:42 AM
Multiple domains pointing to same CI application - by El Forum - 12-08-2008, 05:07 PM
Multiple domains pointing to same CI application - by El Forum - 12-08-2008, 05:35 PM
Multiple domains pointing to same CI application - by El Forum - 12-08-2008, 05:55 PM
Multiple domains pointing to same CI application - by El Forum - 12-09-2008, 02:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB