Our IIS server is configured to have an HTTP response header where the Content-Type is set with a value of
text/html; charset=iso-8859-1.
When running on IIS6, the response header on the client side shows as
and display fine in the browser (IE8). However when using IIS7 the
header shows as
HTTP/1.1 200 OK
Server: Microsoft-IIS/7.0
Content-Length: 3551
Content-Type: text/html,text/html; charset=iso-8859-1
and we get a file download prompt instead.
This issue is related to the fact that the ‘Content-Type’ information is
duplicated and concatenated. Is there a way we can prevent the standard 'Content-Type: text/html' entry from being always part of the response? I didn't figure out a way to do that?
Prior to installing URL Rewrite V2 I need to install the "Web Platform Installer". When I try doing that on a Win2008SP2 server I get the following error:
The Web Platform Installer could not start. Please report the following error on the Web Platform Installer forum: http://forums.iis.net/1155.aspx"
I think for now we will use the standard approach for specifying character set in ASP pages (e.g
<% Response.CharSet =
"iso-8859-1"%>
) until Microsoft addresses this problem directly in IIS.
Thanks!
Simon
Marked as answer by Leo Tang - MSFT on Feb 09, 2010 01:37 AM
Simon Said
5 Posts
IIS7 - Configured HTTP Response Header Issue
Feb 02, 2010 08:02 PM|LINK
Our IIS server is configured to have an HTTP response header where the Content-Type is set with a value of text/html; charset=iso-8859-1.
When running on IIS6, the response header on the client side shows as
HTTP/1.1 200 OK
Server: Microsoft-IIS/6.0
Content-Length: 5051
Content-Type: text/html
Content-Type: text/html; charset=iso-8859-1
<snip>
and display fine in the browser (IE8). However when using IIS7 the
header shows as
HTTP/1.1 200 OK
Server: Microsoft-IIS/7.0
Content-Length: 3551
Content-Type: text/html,text/html; charset=iso-8859-1
and we get a file download prompt instead.
This issue is related to the fact that the ‘Content-Type’ information is
duplicated and concatenated. Is there a way we can prevent the standard 'Content-Type: text/html' entry from being always part of the response? I didn't figure out a way to do that?
Thanks,
Simon
iis7 configuration
eokim
172 Posts
Microsoft
Re: IIS7 - Configured HTTP Response Header Issue
Feb 03, 2010 03:21 AM|LINK
Pleae try to add "charset=iso-8859-1" only for Content-Type.
ie) <add name="Content-Type" value="charset=iso-8859-1" />
IIS7 actually appends it onto an existing header.
Simon Said
5 Posts
Re: IIS7 - Configured HTTP Response Header Issue
Feb 03, 2010 09:28 AM|LINK
Unfortunately that does not work.
> IIS7 actually appends it onto an existing header.
When IIS7 appends the information it puts a comma instead of a semicolon delimiter.
Content-Type: text/html,charset=iso-8859-1
Ref 14.17 Content-Type and Setting the HTTP charset parameter
eokim
172 Posts
Microsoft
Re: IIS7 - Configured HTTP Response Header Issue
Feb 03, 2010 02:57 PM|LINK
IIS uses comma to append header. I think RFC is bit vague on this. It looks like some response header uses semicolon and some uses comma.
Does it actually break your client/browser? What client/browser are you using?
Here is workaround.
If you want to use semicolon, you can use URL Rewrite V2 instead. You can choose your own delimeter.
Please refer to here.
And config will look like this.
<rewrite>
<outboundRules>
<rule name="testrule" patternSyntax="Wildcard" enabled="true">
<match serverVariable="RESPONSE_CONTENT_TYPE" pattern="*" />
<action type="Rewrite" value="{R:1};charset=iso-8859-1" />
</rule>
</outboundRules>
</rewrite>
Simon Said
5 Posts
Re: IIS7 - Configured HTTP Response Header Issue
Feb 03, 2010 03:57 PM|LINK
Yes. IE will display a download prompt instead of showing the document content.
> What client/browser are you using?
We have tried with IE6 and IE8. Both have the problem.
Let me see if the workaround you have suggested works for us and I'll get back to you.
Thanks for your input!
Simon Said
5 Posts
Re: IIS7 - Configured HTTP Response Header Issue
Feb 04, 2010 10:21 AM|LINK
Thanks!
Simon
eokim
172 Posts
Microsoft
Re: IIS7 - Configured HTTP Response Header Issue
Feb 04, 2010 02:46 PM|LINK
"Web Platform Installer" is not required to install URL Rewrite V2. It has its own installer (msi).
Simon Said
5 Posts
Re: IIS7 - Configured HTTP Response Header Issue
Feb 04, 2010 03:49 PM|LINK
- Download x86 RC2 /
x64 RC2
If you click on "Install Now" it takes you to a site that says: and that's how I got the error.namon96
4 Posts
Re: IIS7 - Configured HTTP Response Header Issue
Apr 14, 2012 09:18 PM|LINK
alahamdan
1 Post
Re: IIS7 - Configured HTTP Response Header Issue
May 09, 2012 02:59 PM|LINK
Hello,
Sorry for bringing this back
But i searched all over the web with no result, this is the most relevant post i found
I'm trying to add a custom header for IIS 7.5 to show content-type
When i do so, IE prompt to download file when i navigate to the website (root file is php)
I also noticed that IIS alwasy force comma instead of semi colon! like this:
Content-Type => text/html, charset=utf-8
Any isdea how to solve this?
Note: runin php via fast cgi (if this have any thing to do with it)