I'd like to create fake subdomains for different users for more vanity, and to make the user (in this case a company) feel they are in a more isolated environment.
For the sake of maintainability, it's important for me that all users still browse the same files, to avoid having to update files for every single user that exists when updating the code.
My website has one public part at root, let's say www.example.com
. I'd like to be able to fake the following kind of subdomains:
user1.example.com
The true URL would be www.example.com/member/?user=user1
. I'd like for the folder structure to follow the same pattern. www.example.com/member/settings/?user=user1
would appear as user1.example.com/settings/
and so on.
I assume this would best be achieved with .htaccess
, no?.
What is the proper .htaccess
code for this?
Thank you!