I am working on an application for which I want to create few sub-domains in system, which will be served by Magento application. One example scenario can be creating separate sub-domains for system user's profile. Where User A will have dedicated url user-a.example.com
and user B will have a url user-b.example.com
. Now, I want to able to map these sub-domains to a controller which will in turn fetch profile information and render it for a particular user.
My current approach involves use of Reverse Proxy
on webserver level, where i am mapping subdomains <USER>.example.com
to controller http://example.com/user/profile/index/name/<USER>/
. Which works well untill i want to perfom some operation based on current url. Even though user sees url with subdomain on the page but in the background request is being made to http://example.com/user/profile/index/name/<USER>/
and Magento system returns full url as current page url.
So, I was wondering if there is any way to bind a subdomain to controller directly in Magento system. I went through few questions posted around this but those does not seems to much useful here.