如何像博客一样

问题描述

我创建了一个网站,并希望为我的用户创建虚拟子域。 在红est服务器中可以,并且在调用* .domain.com时,请求将转到主控制器的索引操作。 我可以在Windows Server(Internet信息服务)中做什么。 我想要获取网址并像这样检查用户名

var temp = HttpContext.Request.Host.Value.Split(".");
        if(temp.Length > 1)
        {
            var u = userProfileRepository.Table.SingleOrDefault(x => x.NickName == temp[0]);
            if(u != null)
            {
                return RedirectToAction("DocProfile",new { id = u.UserId });
            }
        }

因此,当用户名为* .domain.com时,我需要将请求发送到domain.com

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)