Ok, I try to build a SAAS that can route multiple domains and trigger the appropriate view.
I need to:
[color="#0000FF"]
1- Parse the domain:
"http://exemple.com" to "exemple"
"http://sub.exemple.com" to "sub" + "exemple"
2- Compare with DB to get tenantID
3- Display the view with the correct domain "http://exemple.com/site/whatever"[/color]
Now I tried to understand URLmanager my guess would be something like this:
'http://<testSub:\w+>.<testDomain:\w+>.com/'=>'site/index',
'http://<testDomain:\w+>.com/'=>'site/index'
Now I would love to access the domain and subdomain like this, it would be awesome…
$mySubDomain = Yii::app()->params['testSub'];
$mydomain = Yii::app()->params['testDomain'];
[color="#FF0000"]Basically, I try to route multiple domains with a DB. How can I extract the domain name and still have the right URL in the address bar? [/color]
Thank you for your time