IIS7 showing iisstart.html instead of default document - iis-7

I've a Sitefinity 4.1 website running on IIS7, I am setting "Default.aspx" at the top of the default documents list, but when I access http://www.*.org/ it shows the IIS7 welcome page.
When I access http://www.*.org/default.aspx it works just fine.
I checked the defaultDocument section in the Web.config and it is set correctly, recycled the app pool, restarted the website site, nothing so far.
What am I missing?
EDIT :
It seems to be a caching problem, if I add junk query string parameters it redirects to the correct page, ex : http://www.*.org/?aaa

Hit F5 on the browser. iisstart.html often is cached in the browser.

ctrl + shift delete on your browser clear all the cache.
then close browser and try again

Related

"http://localhost/" is being automatically added to https urls

As the title suggests, http://localhost/mywebapp is being automatically added to urls within my application.
User clicks an https hyperlink, but instead of browsing to
https://correcturl.something.com
it goes to http://localhost/mywebapp/https://correcturl.something.com
ie the localhost part is being automatically added. I'm sure there is an IIS setting that we are missing here.
It might not be IIS. If you're forming your URLs improperly, I'm pretty sure the browser will handle redirect to "current url" + "redirecting url".
example:
if you execute the following in a javascript console, you will not get redirected.
window.location.href = "/http://google.com";
Running that off stackoverflow page sends me to https://stackoverflow.com/http://google.com
which is incorrect.
I'm assuming that if you're testing urls in some dev environment locally, you'll produce a similar result against localhost. I can't give you a better answer without more information, however I would begin by looking for something in your app similar to what I described.

windows web server 2008 IIS7 keeps rediricting

In IIS7 I right click on the site and choose "Switch to content view" then add a text file called test.txt right click again and switch to features view. Double click the http redirect icon and see it's not forwarding.
Right click the site and switch to content view again now right click on test.txt and choose browse only to be forwarded to some other site that gives me 404 for not having /test.txt.
I don't know where to look anymore as the settings mentioned above would indicate there would be no forwarding but opening the file proves that it does.
When using forcecors plugin for firefox and making a ajax request to the text file I can see the response header: Location http://some_other_site/test.txt.
Hope it's something simple.
[update]
In the application I checked out the settings under "Url rewrite" and found a rule that redirects. Removed this rule and stopped started IIS but it's still forwarding. Could not find anything under System32\inetsvr\config that would indicate redirecting.
After removing the url rewrite rule and testing in the browser it kept on forwarding because I think my browser remembered it was moved. Cache settings on IIS should check if file has changed after it was last cached (I think last modified headers) but somehow a redirect works differently. Did not clear my browser cache and even doing that could still cause a problem with proxies caching it.
What I did was opening it this way:
http://develop.mysite.com/test.txt?refresh=newValue
Like magic I wasn't redirected and it works now. Start FF with another profile and see if that solves the problem as the new profile should not be aware of the sites response being "permanently moved" by a previous request.

Client Not loading Fresh content in IIS 7.5

We have asp.net 4.0 web site hosted on IIS 7.5 on Windows Server 2008 R2 machine. The problem is that client is getting old content but server have updated copies. Client needs to press Ctrl+F5 every time to get the latest contents. Even in the case of data update on grids, client still get old data shown in IFRAME.
What could be the reasons?? Any Idea?? Is this a problem of Cache??
Any kind of assistance will be appreciated..
Page output caching stores a response of a dynamic page, such as an ASP page or an ASP.NET page, in memory after a browser requests it. When subsequent requests arrive for the page, the server sends the cached response instead of re-processing the page.
Check this article, it may be helpful for you.
http://www.iis.net/ConfigReference/system.webServer/caching
These links will also help you
http://learn.iis.net/page.aspx/710/configure-iis-7-output-caching/
https://serverfault.com/questions/126914/output-caching-with-iis7-how-to-for-an-dynamic-aspx-page
IIS7: set "no-cache" for all aspx pages but not images/css/js
https://superuser.com/questions/63014/how-do-i-turn-off-caching-in-iis7
In my case I'm using Chrome Developer Tool viewing source code of Html file hosted on IIS, when I modify the html file and refresh IIS site, the source code show in chrome wasn't modified after refresh the browser.
In the beginning I guess it's IIS caching, but after I try the link in other answer, it didn't really work: https://superuser.com/questions/63014/how-do-i-turn-off-caching-in-iis7
Finally I go to Chrome Setting and clear the Chrome File Cache, the html source code successfully changed. So in my case it is caused by Chrome's Cache, hope it help someone.
Here is what I found, there is an HTTPCompression setting that may have sendCacheHeading set to true.
I found this in the applicationHost.config file and changed it there but it can be changed in IIS also by using the Configuration Editor.
Example:
If you want to change this through IIS select Configuration Editor then click the dropdown arrow at the top and expand system.webserver then select httpCompression.
Per Laurenz request I have copied the text version of what I found in the config file and what I changed it to:
Original:<httpCompression sendCacheHeaders="true" directory="C:\Windows\IIS Temporary Compressed Files" maxDiskSpaceUsage="1000000" noCompressionForProxies="false" noCompressionForRange="true">
Changed to:<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">

Chrome returns "Bad Request - Request Too Long" when navigating to local IIS Express

I have a web application that runs perfectly fine when I use the Visual Studio 2010 development server (Cassini). However when I try to use IIS Express to host the site Chrome just displays a "Bad Request - Request Too Long" error. The IIS Express site does display in other browsers (FireFox and IE9) so I'm kind of confused. The error occurs in Chrome when I try request pages in my application or even basic resources like an image, so I don't think it is an issue with URL rewriting or routing.
Just to see if the problem was somehow a result of my site's code, I created a new MVC3 website and tried running that. This worked in the VS development server, but once again produced the "Bad Request" error when running under IIS Express.
I am about to start testing the site using some mobile devices so I need to get this running under IIS. Any suggestions would be greatly appreciated.
EDIT:
The root url of the site (http://localhost:50650/) is being requested using GET. I am currently using Chrome v12.0.742.112.
I get this all the time ONLY in Chrome and I have to clear browsing data to fix it.
Wrench > Tools > Clear Browsing Data
Check the following:
Clear browsing history
Clear download history
Empty the cache
Delete cookies and other site data
Then click "Clear Browsing Data" button and refresh your page.
UPDATE:
I figured out that it has to do with writing too many cookies to the browser and that if you just close all instances of Chrome, the error goes away for a while. To prevent it, you'll need to clear out your cookies programmatically.
Instead of clearing all the cookies, just do the following:
Right click the lock in the address bar area (see picture below)
Under cookies there is a link saying how many cookies are used
Click that link
Remove all cookies in there (or just the troublesome if you can identify them)
Problem gone
This error is caused by a corrupt cookie for the website you are trying to view, so to clear it all you need to do is clear the bad cookie(s) for that website.
In Chrome, go to...
chrome://settings/cookies
(Or manually go to Settings->Advanced Settings->Privacy->Content->All Cookies and Site data)
From there, you can search for cookies that match the site you are having problems on. Finally, click "remove all" for the matching cookies.
The problem is usually that the site in question has accumulated too many cookies or created cookies which are too large, making the HTTP headers swell beyond the allowed maximum.
One-time work-around
As has been mentioned, you can go to Settings|Advanced|Content Settings|All Cookies and Site Data, search for the site in question, and delete the cookies using the X button on the right. This reduces the header size of the HTTP request when contacting the site.
Long-term work-around
In addition to removing them one-time, however, you can prevent further problems with heavy cookie sites by going to Settings|Advanced|Content Settings|Manage Exceptions, and add the base site url (e.g. "msdn.microsoft.*" without the quotes) and select Behavior as "Clear on Exit". You might have to login more often to these sites, but this should prevent the problem.
I encountered this problem when using ADB2C login from ASP.NET WebApp. In Firefox you can do similar use case to delete related coockies and problem is gone for a while. Click on HTTPS (i) lock icon with, select ">" button on the right, select More information, select Security tab, click on View Cookies and click on Remove All. Done 4 a while.
If Above methods didn't work then enter
chrome://settings/resetProfileSettings
and Click on Reset Settings
This will reset your startup page, new tab page, search engine, and pinned tabs. It will also disable all extensions and clear temporary data like cookies. Your bookmarks, history and saved passwords will not be cleared.

Website needs force refresh after deploy

After deploying a new version of a website the browser loads everything from its cache from the old webpage until a force refresh is done. Images are old, cookies are old, and some AJAX parts are not working.
How should I proceed to serve the users with the latest version of the page after deploy?
The webpage is an ASP.Net webpage using IIS7+.
You can append a variable to the end of each of your resources that changes with each deploy. For example you can name your stylesheets:
styles.css?id=1
with the id changing each time.
This will force the browser to download the new version as it cannot find it in its cache.
For ASP.NET you can use the cache control and expires headers. You can also set up similar headers in IIS 7 for your images. If you have any other cookies you can expire them manually.
I have not tried it, but it looks like you can do an ever better job of bulk setting cache control in IIS 7. See this thread and this link. At that point you are only left with unsetting any custom cookies you have (which you won't be able to control with HTTP cache control settings).
I don't know of any method to "unset everything all at once" easily.
You could use http headers to control the cache of your clients.
I'll just leave this here for you. http://support.microsoft.com/kb/234067

Resources