Ahh ok that sort of makes sense - in my 'CMS' controller I could look
at the hostname, look the domain up and get the associated models..

I guess I need to just find some way of rewriting the URL so they stay
pretty.

On Aug 25, 9:08 am, Pixelastic <timcc.pe...@gmail.com> wrote:
> Maybe you could create a general controller, that will be triggered by
> any request to the cake app. And in a method inside it catch the
> hostname and make the appropriate db find operation to get the
> relevant content and then pass it to the view.
>
> On Aug 24, 11:21 pm, jonoa <jonoaus...@gmail.com> wrote:
>
>
>
> > I think you are referring 
> > tohttp://bakery.cakephp.org/articles/view/one-core-one-app-multiple-dom...
>
> > I believe this scenario is where the author has multiple domains, a
> > single app but a different DB containing the application specific data
> > for each domain. He hacks bootstrap to match the header hostname to a
> > config subdirectory and loads the appropriate db config file.
>
> > Not quite what I'm looking to achieve but some good concepts there.
>
> > On Aug 25, 1:25 am, Martin Westin <martin.westin...@gmail.com> wrote:
>
> > > Did you check the bakery?
> > > I think I remember seeing something like that in some article a while
> > > back.
>
> > > /Martin
>
> > > On Aug 24, 3:38 pm, jonoa <jonoaus...@gmail.com> wrote:
>
> > > > Hello all
>
> > > > Big thanks to all the people who contribute to CakePHP - has certainly
> > > > put some structure in to my development and I'll be donating as soon
> > > > as I can monetize what I'm working on. :)
>
> > > > I'm writing an app at the moment - basically it will allow the user to
> > > > login, fill out some forms and basically spit out a pre-fabricated
> > > > website complete with a registered domain.
>
> > > > The interface for the user to login and submit the content for the
> > > > site and register domains etc is done, the content to be used for the
> > > > user-generated website is spread across a few models. I've built a
> > > > controller (web) and appropriate views (about, contact) to make this
> > > > data available. The website is also themed using native cake
> > > > functionality allowing users to pick from a bunch of different themes.
>
> > > > My question is this - how can I present the newly generated website
> > > > and maintain the domain it was registered with? i.e. I can easily make
> > > > my themed website available using /web/about/id:1 and /web/contact/id:
> > > > 1 - but I need to make it accessible through mydomain.com/about and
> > > > mydomain.com/contact. Similarly /web/about/id:2 and /web/contact/id:2
> > > > would be accessible through myotherdomain.com/about and
> > > > myotherdomain.com/contact.
>
> > > > So the workflow is something like this..
>
> > > > 1. User logs into corpsite.com
>
> > > > 2. User enters content information into, essentially a CMS and a
> > > > domain is registered for the user-site in the backend (i.e.
> > > > mydomain.com)
>
> > > > 3. Domain is configured in DNS and Apache to point at the corpsite.com
> > > > cake application
>
> > > > 4. Anyone who visits mydomain.com/about or mydomain.com/contact is
> > > > essentially seeing a view rendered by corpsite.com/web/about/id:1 or
> > > > corpsite.com/web/contact/id:1
>
> > > > The tricky part is ensuring the URL for anyone visiting is the same as
> > > > the domain that was registered.
>
> > > > I'd like to keep everything as one app - I'm not sure if this is
> > > > something I should be tackling in cake (I looked at routes - but I
> > > > don't think it can match on hostname? In any case, if there was
> > > > several hundred of these sites, would surely degrade performance too
> > > > much). I'm thinking that mod_rewrite will definitely be involved
> > > > somehow. Apache I'm pretty sure I can just use a wildcard virtual host
> > > > and point it at the same app directory.
>
> > > > I considered having the app write out a new directory structure and
> > > > copy views etc over for each site, but I think that is not going to be
> > > > maintainable.
>
> > > > I think I have the various pieces - just not sure how to architect
> > > > them. The fact that my cake app has knowledge of the relationship
> > > > between the domain and the model for the content makes me think I can
> > > > do this in cake. Scaling out to potentially hundreds of domains needs
> > > > to be kept in mind.
>
> > > > I'm not sure if this makes sense - any advice is greatly appreciated.
>
> > > > Kind Regards
>
> > > > Jon- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to