ASP.NET MVC website redirects to local IIS instead of IIS in any browser

Goal:

Run the ASP.NET MVC website locally in IIS in any browser.

Story:

The project of concern is the ASP.NET MVC website, which was originally configured to use local IIS with SSL enabled. I tried setting it up on IIS express:

Website configuration

File RouteConfig.cs

public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "_View", id = UrlParameter.Optional } ); } 

There are 2 redirection options in web.config

For authentication

 <authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" /> </authentication> 

For error handling

 <customErrors mode="RemoteOnly" defaultRedirect="~/Views/Error/Error.html" redirectMode="ResponseRewrite"> 

Problem:

Although the above configuration is complete, the site is redirected to the local IIS ( https: // localhost ) instead of IIS express delivery (for example, http: // localhost / 12345 or https: // localhost / 12345 ).

What is still used:

There is a question mark on the site that must be immune inside IIS

multiple procols

After removing the https binding, redirection occurs, however the page does not seem to load.

https removed

Visual studio allows you to debug Application_Start() and Configuration(IAppBuilder app) . Subsequently, any breakpoint does not fall.

This happens with all controllers and actions in all browsers.

Where am I going wrong? or is it some kind of mistake?

+3
c # asp.net-mvc url-redirection iis iis-express
Dec 07 '15 at 9:47
source share
1 answer

Not sure what a hack is behind this ...

To run the ASP.NET MVC website on IIS Express (instead of Local IIS) with SSL enabled, you need to make sure that the 5-digit URL port starts with 443 xx

where xx can range from 0 to 99

443xx port

Now redirection also does not occur . Website Works Great on IIS Express

+3
Dec 10 '15 at 15:03
source share



All Articles