0

I have asp.net mvc 5 application which has an admin controller and only authorized users can call actions of this controller.

Url is like www.example.com/admin, When anyone opens that url sees a login page. And all admin pages are in this controller.

www.example.com/admin/orders www.example.com/admin/payments

But now i need these pages as subdomain like "admin.example.com". How can i achieve that. I am very new at MVC interface.

Can
  • 659
  • 1
  • 7
  • 24

1 Answers1

0

MVC doesn't have any built-in support for subdomain. You can achieve it via one of following way as per my knowledge.

Add new sub domain from your control panel(if it is included in your hosting package) and map above url with that.

OR

you can refere to following entry how to add wildcard setting to match any non-existing domain.

Check this link

After that, with the help of custom HTTP Handlers and HTTP Module you can easily redirect to admin page when request come as www.admin.example.com

Community
  • 1
  • 1
K D
  • 5,889
  • 1
  • 23
  • 35