I am looking for a solution to create subdomains programmatically in ASP.NET, ASP.NET MVC and PHP. Specifically, a user profile page should resolve for both: www.domain.co
www.domain.co
There is no generic way to create subdomains. You will need to call an API provided by your ISP or DNS provider -- typically SOAP or REST.
Either that, or use a wildcard domain (*).
On the IIS side, be sure to configure you application so that it doesn't use Host headers.