Friday, October 1, 2010

Re: Using multiple domains on one app to create four seperate sites

You can use apache's namevirtualhost directive plus server aliases to point all the domains to the same web root. After that all you have to do is inspect the hostname in the $SERVER super global and use that to switch the app's theme (this gives you the flexibility to have domain specific layouts, views and elements) or just switch the layout. A good place to deal with this is the beforefilter callback.

On Oct 1, 2010, at 9:26 AM, Jacob <jacobsteringa@gmail.com> wrote:

> Hello all,
>
> I am working on a website for a company, which needs five different
> websites. The five websites use the same database and mostly the same
> records. For site specific records there is a 'company' column in the
> table. With a parameter a function will know what records to get.
>
> The current setup exists of one app on the webroot en 4 others in a
> sub directory. This was the easiest way to solve the problem, but it
> has a down site. As the development is in a final stage, the
> controllers and views are modified a lot. For every change the other
> four apps need to be changed also.
>
> My question is:
> Is there a way to create the illusion of five different websites while
> it is actually one app? For example, based on the domainname used, the
> layout changes? (that would be the best solution I think) But is it
> possible en how should this be done?
>
> Best regards,
>
> Jacob
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: