Re: How to set content-type header for ASP/HTML pages only ?
From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 02/16/04
- Next message: David Wang [Msft]: "Re: Turn Off Cache ISAPI Applications in IIS 6.0"
- Previous message: David Wang [Msft]: "Re: Signing on Internet Explorer"
- In reply to: Alan Silver: "How to set content-type header for ASP/HTML pages only ?"
- Next in thread: Alan Silver: "Re: How to set content-type header for ASP/HTML pages only ?"
- Reply: Alan Silver: "Re: How to set content-type header for ASP/HTML pages only ?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Feb 2004 15:08:01 -0800
The right way to do this association is with a MIME-Type (IIS can configure
this on a per-URL level, meaning you can even make SOME ASP pages return
custom values but not others, depending on URL scope), which allows you to
set the value of the Content-Type header on a per-extension basis. This
requires restarting IIS for it to take effect.
What you were doing was setting headers that IIS sends on all requests,
which is valid for other uses, just not for Content-Type.
-- //David IIS This posting is provided "AS IS" with no warranties, and confers no rights. // "Alan Silver" <alan-silver@nospam.thanx> wrote in message news:TwL$pdLdJPMAFwLh@nospamthankyou.spam... Hello, I would like to set the content-type HTTP header for Content-Type. I tried adding the header :- Content-Type: text/html; charset=ISO-8859-1 as recommended by the W3C, but this sends this header for *all* files served, not just ASP and HTML. For example, it sends the header for CSS files, which causes the validators to choke. Is there any way to set the Content-Type specific to file type ? I searched Google, but didn't find anything on this. It seems strange to be able to set a global Content-Type, but not be able to associate it with a file type. TIA P.S. I am using IIS4 on NT4 Server if it makes any difference. -- Alan Silver
- Next message: David Wang [Msft]: "Re: Turn Off Cache ISAPI Applications in IIS 6.0"
- Previous message: David Wang [Msft]: "Re: Signing on Internet Explorer"
- In reply to: Alan Silver: "How to set content-type header for ASP/HTML pages only ?"
- Next in thread: Alan Silver: "Re: How to set content-type header for ASP/HTML pages only ?"
- Reply: Alan Silver: "Re: How to set content-type header for ASP/HTML pages only ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|