I do a lot of domain-specific stuff for dealing with configurations.
Your new friend is called $_SERVER['SERVER_NAME'] :)
I parse that to pick out the part of the domain name I need to load
the correct configuration.
You can do the same and use that to load the correct user profile.
I would try setting a new route from bootstrap.php. Something like:
Router::connect('/', array('controller' => 'users', 'action' =>
'profile', $parsed_username));
Just remember, this will still enable crafty people to access any
other part of your application on domain so I would also want to
"unset" all other routes or in some other way forbid any other url but
the root for these domains
You also need a total wildcard vhost in apache since you will not know
which domain names will be pointed at your server.
hm...
You could also set up the vhost in apache to provide you with the
username and also point the visitor to a "version" of your application
that can only host that one page...
/martin
On Mar 23, 9:04 am, Turgs <[email protected]> wrote:
> Hello
>
> In my cake app, each user has their own "profile" page, which
> ishttp://www.example.com/users/profile/{user-name}
>
> When user's join my website, I want to give them the ability to attach
> a domain name to their "profile" if they choose. So for "user-a", a
> visitor who goes tohttp://www.user-a.comwould actually be directed
> tohttp://www.example.com/users/profile/user-a
>
> Assuming the user has configured their DNS settings correctly, what do
> I need to do on my application's side of things to make this happen?
> How can I make this automated and seamless for the user during their
> "registration process"?
>
> Can someone please help me locate any resources so I can learn how to
> do this or what I would search for?
>
> Thanks
> Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---