I would just use a wildcard to indicate all subdomains in a specific directory and have a front controller there that determines which one to use from the URL - this is the simplest and safest solution from PHP.
EDIT . Then you can obviously check if it should be existing (store them in a database, etc.), etc.
Franz source
share