I´m planning to develop a SaaS where the users can have their own subdomain with its template based page.
This is what I´ll have
- php/MySQL web application, using Yii
- users(tenants)
- templates on specific folders(html, php, jpg, etc.)
- users will define a subdomain and choose a template
This is what I need
- This one is easily done with PHP I guess: knowing what subdomain is being used then filtering data by tenant related to subdomain and then getting the physical folder of the template chosen to use it as base URL and render the page, if I´m right, no need to answer this.
- This one I don´t know: Keep the subdomain ALWAYS visible and everyhing filtered according to it.
So I know is going to be htaccess related in which I really don´t know much of it so I´m investigating about it.
If the code is kind of complex it would be great if at least someone may do some pseudocode or explanation of what would I need to search for.
I know also I can use a Multisite CMS or Blog and get done with it BUT we plan to expand and have specific functionality needs.
thank you
--- Edited --- Int other words, I just need the subdomain to work as wordpress.com does it in their free blogs, is it a code in the htaccess?