For the subdomain thing, many people have done it before and it's
discussed in this list, but I've never done that myself, so sorry I
can't help you on that.
On the routing thing, I think this shoul do the trick:
Router::connect('/contest/:contestname/:action/*' , array('controller'
=> 'contest', 'contestname' => '/[a-z0-9]+/'));
On Sat, Mar 29, 2008 at 6:27 PM, John R <[EMAIL PROTECTED]> wrote:
>
> I have an application that features a number of "contests". The root
> of the site houses all of the core site functionality (domain.com/
> login, domain.com/register).
>
> Originally, I wanted to use dynamic subdomains to handle the
> contests ..
>
> so http://contestname.domain.com would open that contests mini-site
> (new layout, css, etc.)
>
> and http://contestname.domain.com/action would be an action inside the
> 'contests' controller.
>
> The logic problems I ran into with this are two fold:
>
> a) How would I setup the routing/logic to recognize that any valid
> subdomain.domain.com and subdomain.domain.com/action uses the contests
> controller, and if you tried to access a contest-specific action from
> the root (www), it would not allow it.
>
> b) If you are inside a contest and you click 'login', how would I get
> it to take you back to the root (www) and then do /login
>
> (If anyone has feedback on how to achieve this, I am ALL ears.)
>
> I sort of gave up on the subdomain idea as it seemed way too complex.
> I conceded to doing something like this:
>
> http://www.domain.com/contest/*contestname*/action
>
> However, I was having a hard time with the routing here. Obviously,
> everything here would be done in the Contests controller, and
> *contestname* would be a variable that basically controlled everything
> that section did, including redirecting back to root if it wasn't a
> valid contestname. Anyone know how to achieve this?
>
> Finally, with all of that said, are there better ways to do this?
>
> Any insight on any of the above issues are appreciated!!!!
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---