I have an MVC5 Application, published on remote server, that has the HomeController with About ActionResult method, i have the RouteConfig.cs configured as follows:
routes.MapRoute("Default",
"{controller}/{action}",
new { controller = "Home", action = "Login"});
However, when i navigate to the publish URL as 192.xxx.1.xx/MyApp, the login form is openeed as expected, but after entering the userName and password and submitting form, where submit redirects to Post Method Login in HomeController with following code:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Login(SSERPService.UserName userName)
{
return RedirectToAction("About");
}
the URL changes to 192.xxx.1.xx/MyApp/Home/About, but the page displays "Nothing found" (The controller method "About" seems not to be hit), same behaviour happens when entering the URL to the About page manually as "192.xxx.1.xx/MyApp/Home/About" from the browser URL tab, where the page displays "Nothing found", However, when changing the RouteConfig "Default" as the code below:
routes.MapRoute("Default",
"{controller}/{action}",
new { controller = "Home", action = "About"});
and then navigating to 192.xxx.1.xx/MyApp, then the "About" page gets displayed, and the URL in browser stays as 192.xxx.1.xx/MyApp,
How can i let the manually Entered URL in browser URL tab and the RedirectToAction display the intended page "About"?
Note: the published version on the local machine doesn't cause this problem, only the hosted version on remote server
Please Advise,
Thanks in advance,