In my platform, each user has their own config file. The file is named by the subdomain they created.
Example:
user1.domain.com
user2.domain.com
user3.domain.com
The system reads the url via $_SERVER['SERVER_NAME'] and grabs the subdomain. It then looks up the appropriate config file based off of the subdomain.
Example:
if the url is user1.domain.com the system looks up user1.config.php.
Each users has the option to use there own domain. I am currently doing this by pointing the A record.
Example:
user 1 points theirDomainName.com to my IP address via their A record
how can I use htaccess so the url reads theirDomainName.com
but backend of the platform (php) reads user1.domain.com
thus the platform knows to pull the user1.config
file
$_SERVER['SERVER_NAME']
based on it.theirDomainName.com
" whch is a duplicate of serverfault.com/questions/62527/…