When the login page is rendered, I want the Url to be empty. So I added this route
routes.MapRoute(
null, // Route name
"", // URL with parameters
new { controller = "Account", action = "LogIn", id = UrlParameter.Optional } // Parameter defaults
);
The problem is, when I log in I should be redirected to index which also has an empty Url. So I can’t get the page index.
How can I have two empty Urls for two different actions?
Thanks.
I don’t think you can, and I wouldn’t recommend it either.
If you have two different pages, they should have 2 different URLs.
However, you could have something set in your homepage controller which checks whether they are logged in, and redirects to your
LogInaction: