If you are using Windows as your local dev environment this I am
pretty sure this is impossible.
Windows can't handle local wildcards in hosts (windows\system32\drivers
\etc\hosts)
(Won't work)
127.0.0.1 *.site.local
(Will work)
127.0.0.1 sub1.site.local
127.0.0.1 sub2.site.local
You will also have to edit your httpd.conf to include the wildcard for
ServerAlias
ServerAlias *.site.local
On Sep 28, 11:17 am, Adwin Wijaya <[EMAIL PROTECTED]> wrote:
> Grant Cox wrote:
> > What you want is a wildcard subdomain. Register in DNS
> > *.yourdomain.com, and handle the same in your webserver, pointing to
> > your cake app.
>
> > Then the first step in your app (in beforeFilter) should be to look at
> > the env('HTTP_HOST') to determine if the subdomain requested is valid
> > (matching a user account or whatever). If not, then 404, or show a
> > "account not found" page, whatever you like.
>
> Can you tell me how to register dns ? I am still using my localhost
> for testing at the moment (with host modification so that it looks
> like in the real server.)
>
> shall i modify the .htaccess as well ?
>
> thank u
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---