How to create an accounting system, for example, 37Signals?

How to create an account system, for example, 37signals, which:

Each user receives an independent URL. user.domain.com A certain number of users are added to each user:

And when they allocate resources for accounts, do you think that all this is in one database or do they create a separate database for each account?

+3
source share
2 answers

you can use one of two methods for user subdomains - can you either use the rewrite HTAccess rule to redirect the subdomain back to the .php page? sub = user, uploading his account - htaccess redirect the subdomain to the domain or (if you are on CPanel Hosting), there are examples around how to automatically create and specify subdomains using only PHP and cURL - http: //www.zubrag. com / scripts / cpanel-subdomains-creator.php

Although I'm not sure how the 37signals database works, I doubt that they create a new database for each user - it looks more like they simply associate multiple tables with indexes. If the fields are not previously known, you use a simple EAV scheme so that users can define their own data fields.

+2

, nginx ( , ). , PHP script, . , .

NginX Server Server_Name

+2

Source: https://habr.com/ru/post/1786009/


All Articles