ASP.NET Forms Authentication Url encoding
I am deploying an ASP.NET MVC 2 (.NET 4) application to a Windows Server 2008 R2 server.
I have setup the application pool and the website in IIS. The application is using F开发者_运维知识库orms Authentication.
The application works fine if I go to my login page first (http://mydomain.com/authentication/login). I can login and then use the application just fine.
If I just go to the root of the domain or anywhere besides the login page before logging in it redirects to http://mydomain.com/authentication/login?ReturnUrl=%2fsome%2flocation which causes Firefox to give a "Connection was reset" error and IE to say "Webpage cannot be displayed".
If I manually remove the URL encoding (http://mydomain.com/authentication/login?ReturnUrl=/some/location) everything works fine.
So my problem seems to be that ASP.NET (or maybe IIS) cannot process the encoded URL.
Any ideas?
Thanks,
Justin
UPDATE
I've created an MVC 3 application and copied the files into it. Still has the same problem. Everything works fine when running with Cassini in VS2010.
UPDATE 2
Ok so I have simplified this even further. I created a virtual directory off of Default Website in IIS and put in an index.html file that says Hello World. If I go to http://somedomain.com/test/index.html all is fine but if I go to http://somedomain.com/test/index.html?redirect=%2f I get the same "Connection has been reset" error. I guess this narrows it to an IIS problem. Any ideas?
SOLVED
It turns out there is nothing wrong with my application or IIS. It is actually a problem with my workstation. Attempting to view any URL that has an encoded forward slash in it (%2F) causes this error in all browsers. Viewing the application from other computers works fine.
精彩评论