I want to create in my app, something like cms, but so simply and easy.
Every user will have subdomain like "alias.myapp_domain.com".
Users have a module for manage web and other functions (not only web is the point of app).
I have an admin module for management whole application - users, payments etc.
I want to create "WEB Module" for handling every request "subdomain.myapp_domain.com".
Request of "myapp_domain.com" should go to main module, but every request of subdomain should be redirect to web module, where I want takie "subdomain" into app, and show appropriate website of user with this alias.
Then you can obtian the subdomain by using $_GET[‘subdomain’] anywhere in your code. Of course you need to change the rule and maybe add more rules to handle all the requests.