On Mar 26, 2011, at 04:15, hunny wrote:
> I want to prefix my site url, say www.example.com, with the username,
> say user1, so that the url looks like www.user1.example.com.
> Any ideas on how to achieve this.
First you'd need to set up your VirtualHost directive in Apache with a
ServerAlias directive that matches every possible hostname you want it to
serve, like
ServerAlias *.example.com
or maybe
ServerAlias www.*.example.com
(not sure if that last one works)
Then you'll need to program your CakePHP app to recognize the hostname in the
HTTP request and do something (whatever you're wanting to do) with the username
part.
> Also wondering if I will need to change HTML Helper so that all the
> links are prefixed with username.
The links your app generates would only need to include the protocol and
hostname if the hostname changes. Otherwise the existing helper method is fine.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
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