I have a CakePHP website that is designed to let users generate their own simple 1-4 page sites.
The idea is that people go to app.example.com (where the website is hosted), create an account, and generate their website.
After generation, their website gets an ID (I have this setup as a UUID instead of a sequential counter).
Currently, users can access their websites by going to example.com/websites/{PAGE}/{WEBSITE ID}
I want to reformat that into {WEBSITE ID}.example.com/{PAGE}.
I am running all of this on a Linux server with apache, and my plan would be to use some form of wildcard DNS record for all subdomains. Users would not be expected to use their UUID subdomains for their website, but they would instead be expected to purchase a domain and setup a CNAME record.
My initial thought would be that this would somehow be done with apache, but I am not sure.
Any help or advice would be appreciated.