Firefox The page isn't redirecting properly

2019-04-30 07:32发布

问题:

When I go to a particular url on my asp.net-mvc-3 site I get this error in Firefox. The page in question is a login screen.

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

Chrome says

This web page has a redirect loop The web page at has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

Here are some suggestions:
Reload this web page later.
Learn more about this problem.

Why might this be happening? After reloading a couple of times the problem does go away.

回答1:

Open Fiddler (download) and look at requests, you will find some count of HTTP redirects, then browser will stop and show such messages. You need debug your application, maybe this is some cross redirects, custom return url logic or anything else, without code it's hard to understand what is going on.



回答2:

We had the same problem, Login.aspx page was redirecting to default page ~/. Solution was hard to find, but going deeper revealed that IIS server has from some version set Login.aspx as default page. Hence there was indefinite loop in redirecting, the removal od Login.aspx from default pages (Default Document) in IIS GUI(!) solved the problem. Hope this helps somebody. Just changing config files was not enough, the GUI approach worked well.