I am creating a website with a small administration panel. The administration panel lets the users change some styling and content on their site (primary color, background image, description etc).
The information about their site is stored in a database.
Let's say, hypothetically, that I sell this website to a thousand different customers. What I want is for them to be able to visit their domain and see their content and styling.
I am looking for some tips or pointers as to how this can be done.
My thoughts so far:
- I need to store all the customers site properties in a database with an unique identifier (this basically already exists).
- I need to have all my customers domains pointing to where I host the website (if they don't have a domain, I want to use a subdomain of my own domain).
- I need some check in my code that differentiates what domain a request is coming from.
- I need to be able to look up what identifier in the database corresponds with the domain in the request
- Lastly I need to serve the correct information from the database.
Would this be the correct and scaleable way to do this? Is it feasable for a thousand different sites?
Another option would be to host one instance of the website for each customer, but I think that would be a nightmare to maintain.
Can anyone tell me if I am on the right track, and if not, how it can be done?
I apologize if this is posted in the wrong "forum".
Thanks
Aucun commentaire:
Enregistrer un commentaire