How can I divide a website where each state has it’s database and url string?

how can you divide a website url string by states, but under one domain?

for instance.

Can each string above have separate databases as well?

How can I divide a website where each state has it’s database and url string?

Usually you can define a separate “DocumentRoot” for each subdomain (see your hosting provider cpanel) and than place the same code in each documentroot directory with the only difference being a database name these copies are using

you have to subdomain

You can set up a wildcard * DNS entry with your domain registrar or web host (wherever your DNS is hosted) and you will probably have to ask your web host to make the necessary configuration changes. I think you will have to use mod_rewrite to rewrite the subdomain in the form of ->

Did you try searching here at Sitepoint? I know this question has been asked many times before.

As for setting up separate databases for each state, there is little good reason for doing this. Managing fifty databases is going to be much more difficult than managing one.

An easier alternative would be to use mod_rewrite and the state name after the slash like this: or

I do not know if this is any longer true, but I believe Google used to view each subdomain as a separate site. If so, this will not be beneficial to you. Check this out for more information:

Why you say would be not beneficial in terms of searching on google?

Chances are, all your sites will have more or less the same content, so google will think they are different sites, and only rank one of them (it will think the rest are copies).

Off Topic:

Not wanting to take this too far off-topic Vali, but isn’t this where canonicalized headers come into play?