开发者

routing for m.sitename.com in mvc

I want to configure the routing in such a way that when some request come from smartphone/device, my site pages redirect it to m.site-name.com, where 开发者_运维百科it open some view for m.site-name.com.

at my default page, i used wurfl services, they detect the device.

  • my site-name.com (non smart devices) points to home/index (controller/action)
  • my m.site-name (for smart devices) points to devices/index (controller/action)

for the first case, it will work

routes.MapRoute(
      "Default",// Route name
      "{controller}/{action}",  // URL with parameters
      new { controller = "Home", action = "Index"}  // Parameter defaults
); 

The same work for my smart device routing but How do i tell this routing table that when request come from site-name.com, it has to point home/index and when request come from m.site-name.com,it has to point devices/index.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜