ASP.Net Forbidden URL with Internet Explorer - asp.net

I have an issue here which has me baffled.
Another developer and myself developed an ASP.Net Web Forms application four years ago and the site has been live since. About 6 months ago we moved the application from a Windows 2003 web server using IIS 6, to a Windows 2008 web server using IIS 7.5. When we moved servers we tested the application again in the Firefox web browser, however, I can't remember if we also tested in Internet Explorer. We should have done.
Recently it has been brought to our attention that in Internet Explorer, when a user attempts to hit some of the pages within the website, they are presented with a
Forbidden URL
HTTP Error 403. The request URL is forbidden
I have also tried to recreate this error on my local computer and I also get an error
HTTP Error 400 - Bad Request
This only happens when using an Internet Explorer web browser, it works fine with the likes of Chrome, Firefox etc.
I am not sure how to fix this, but because myself and the other developer have not changed any of the source code, I don't think this is where the problem lies. I have a feeling it might have something to do with IIS on our new web server, but I am really not sure.
Has anyone else seen this problem before?
Any feedback would be greatly appreciated.
Thanks.

Folks, the problem for some reason was as follows:
When a user clicked a button on my site which would then redirect them to another page within the site, I previously had the following code to do so
Response.Redirect("../userprofile/myprofile.aspx")
However, after the release of IE 10, this redirect would no longer work, and instead I had to replace it with
Response.Redirect("~/userprofile/myprofile.aspx")
Hope this helps someone else who is having similar problems.

Related

Weird characters rendering on IIS

I need some help. I have an old website hosted on IIS 8.5 on a Windows Server 2012 R2 and today its not working anymore. The event viewer doesnt show any erros but if I inspect the code on Chrome or IE it renders like this:
And also sometimes it shows strange characters:
Does anyone knows whats happening and how to fix it? There is no new code or changes to the project.
If you can, try to restart IIS and see if that helps.
I've run into it a couple of times, often when multiple sites are hosted in the IIS. I don't know if it's the handlers or filters that eventually gets bogged down and starts to act wierd, and I've honestly not bothered to troubleshoot it further than restarting IIS, or in worst case, the server.

404 Error on existing pages

Have an issue where I get a 404 errors on multiple pages that definitely exist on the server.
It is an ASP based website and at completely random points I get a 404 error for those pages that definitely exist on the server as after I do a refresh it's absolutely fine.
Weird thing is that when I open developer tools I never receive the error anymore.
Any chance that developers tools is actually interfering with the connection between browser and server and actually changes something?
Why I'm not getting the error while developer tools is running?
Has anybody got anything similar to this before?
I am using Internet Explorer 11 as well as tried Internet Explorer 10.
Same on both browsers.

Site functions locally, "Internet Explorer cannot display the webpage" on server

I have an ASP.Net Website (not a web app, fwiw) that builds and works just fine locally through IIS on my dev laptop.
However, when I publish it to our QA box and try to view while I'm remoting into that server, I get a message from IE saying "Internet Explorer cannot display the webpage". Firefox just spits back a quick "Connection Timed Out"
There is absolutely nothing in the event log nor the IIS log about this. I'm unsure where I can look for more info.
I'm fairly confident it is an ASP.Net issue. I can install a sample site from our vendor, Ektron, into IIS and it will run. If I overwrite the sample's web.config with my own, it continues to run. If I then blow away the entire sample site and copy over my site from my local, I'll get the message about how "Internet Explorer cannot display the webpage".
I've tried to keep the environments as close together as I can. Both boxes are running IIS 7.5 under an integrated app pool for .Net 4.0. I browse via localhost on dev and via an IP on the server.
I am not terribly familiar with the Website template, so I might be missing something obvious (I hope!). I'm hoping someone can provide some guidance into how I can get more info on what the heck is going on so I can resolve this issue.
UPDATE
I think I'm getting closer. By using Fiddler (thanks for the suggestion, Amy!) I notice that it redirects the request to SSL. SSL requires a different license from our vendor, so that might be it. I'm still trying to understand why that redirect is taking place, but at least I have something now to look at.
I'd look into the SSL settings in the web.config / IIS - settings for Mime Types and also into Ektron's MIME Types in the MimeType.config file. I found that some .aspx pages like (ekajaxtransform.aspx) weren't functioning correctly because of firewall/proxy issues/restrictions.
Hope it helps. :)

ASP.NET Development Server 403 Error

I'm developing a web application in Visual Studio 2010 on Win 7, and now seem to have a new error that has just popped up. When I try to access the site which uses Windows Authentication, in Firefox, I get a 403 error, with no subcodes. Up until this poijnt, it has been working this way just fine. Firefox prompts me for my credentials, and I enter them and then I get the 403 error. No problems with it in IE, just Firefox.
I've checked the network-trusted-ntlm-automatic key in Firefox and deleted my session cookie, but still no luck. The problem seems to be limited only to Firefox.
If I set the app to be Anon access, it works with no problems, but the app needs to be Windows Auth.
I attempted Local IIS, but there wasn't an option for Windows Auth for the app on my local IIS, so that kind of removed that option for the time being.
Any ideas out there for how to get this working correctly again? I'll take answers that get me the Windows Auth option in my local IIS as well, because that would also fix the problem for me.
Check to make sure directory browsing is not enabled for the site. Also, make sure your default documents are setup so when you go to: http://www.yoursite.com/ (notice the slash at the end of the url) a default document is loaded. I have seen in some cases where IIS thinks you want to browse the directory rather than load a page. See if you still get the 403 error by going to a specific page.
I'm running windows 7, 64bit with IIS 6.1.
To turn on Windows Authentication, go to Control Panel -> Administrative tools and select IIS Manager.
In the left panel, expand Sites, Default Web Site, and select your Virtual Directory. You should see Asp.Net in the top panel and IIS in the middle. The first icon under the IIS section is Authentication, double click this. You can then disable annon and enable windows by selecting from the drop down list and clicking Enable / Disable from the actions on the right side of the page.
Hope this helps.
After some digging I finally found the answer, but it wasn't where I expected it.
I was digging through Event Viewer trying to figure out why I kept getting Account Lockout messages when trying to load the site with Firefox and did some searching came across an article that specified how to add multiple servers to the Firefox network.automatic-ntlm-auth.trusted-uris key in about:config.
I had specified:
http://host1; http://host2
and instead should have separated with commas
http://host1, http://host2
I changed it to commas and reloaded and it is now working correctly with the Windows Authentication in Firefox.
Hopefully someone else finds this particular fix useful. Small typo, big headache.

Posting forms to a custom 404 Classic ASP URL in IIS7: where is the post data?

Have recently migrated a number of websites from an ageing Windows 2003 server running IIS6 to a new Windows 2008 server running IIS7.
The sites all use a CMS written in classic ASP which requires that the 404 error is modified to load a default.asp file which looks at the URL and loads content from a database. This is just to keep all the URLs nice and SEO friendly.
The back office of the CMS works in a similar way (except the 404 error is dealt with by admin/default.asp).
For some reason though, the login page (which obviously involves a form posting to the custom 404 error) does not carry over the POST information.
OK - here's the weird bit. It works fine in Google Chrome, but not in IE7/8 or Firefox.
Obviously this is right royal pain in the harris.
Any ideas why post data is carried through the custom 404 handler for one browser but not any others?
I've got as far as I can and am currently trawling the web for information about this but can't seem to find anything...
OK - here's an update for the weird bit.
It works fine in Safari as well as Google Chrome - but not in IE7/8 or Firefox.
???
I'm not sure this helps, but check this question Posting forms to a 404 + HttpHandler in IIS7: why has all POST data gone missing? and this hotfix by Microsoft

Resources