1

I'm managing a portal type website where authenticated users have an individualized 'homepage'.

http://www.myWebSite.com/MyHomePage

I'd like to understand how to implement that same functionality to a subdomain name:

http://MyHomePage.myWebsite.com

So requests that come via the MyHomePage subdomain will authenticate the user and then render the same page as if they used the longer URL: http://www.myWebSite.com/MyHomePage

thx

0

2 Answers 2

1

Create a new class called YourDomainRoute that inherits Route and simply convert the sub domain to a controller name (or whatever you like) in the GetRouteData() method.

You also need to override GetVirtualPath() if you want @Html.ActionLink etc to automatically use your custom route.

0

You would do this with a custom RouteHandler. See Here.

There is also a similar blog post by Tony Williams for MVC 2 (it should still apply)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.