I am building a portal which will have different cities content..
When someone comes to the website i want them to choose the city and then proceed
to
or
can this be done using a single database and installation of cakephp ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes it’s possible.
Basically in your DNS you have to allow *.site.com to be hosted on a single machine.
This way, no matter what subdomain you type the machine will be the same.
an example dns record:
Then in the virtual host declaration you have to put
this way no matter what you type i.e. something.site.com or city.site.com will be redirected to a single app.
Then you have just to parse the host from the php (preferably in AppController) and to transform the subdomain to filter.
It’s a little bit abstract, but that’s how I would do it.
Edit (response to the comment):
It’s a matter of how it is build the system. Basically if yo have:
in your AppController you can have something like:
So basically, after this it depends what is your application architecture and how you deal with this city.