views:

25

answers:

1

Is there a way to set a new Controller other than Home when a condition is met?

I want to be able to specify a default controller other than Home when a user is logged in.

So before a user logs in I want to use the default Home controller but once they have logged in I'd like to use say the User controller.

Better yet is there a way that I can use the following;

www.mysite.com/home/index when not logged in and, www.mysite.com/griegs when logged in.

www.mysite.com/griegs would then route to my User controller where 'griegs' is the Id/userName.

A: 

You can add to the global on start functions to intercept the requests before they hit the action itself... there you can check what's been requested (including the request URL) and redirect to a different action or the like as required.

David Burton