W3C HTML Validator Error - Invalid content-type

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Trevor Orton

    W3C HTML Validator Error - Invalid content-type

    Hello, I'm having a slight problem using the W3C html validator and I've
    reviewed the FAQ's with no luck so hopefully someone here would be kind
    enough to point me in the right direction.

    I recently validated my site's css and the bulk of the html pages via the
    W3C validator but was forced to use the file upload option because the
    'Validate by URL' option returns the following error:[color=blue][color=green]
    >>Sorry, I am unable to validate this document because its content type is[/color][/color]
    http://www.ortonage.com, which is not currently supported by this service.
    The Content-Type field is sent by your web server (or web browser if you use
    the file upload interface) and depends on its configuration. Commonly, web
    servers will have a mapping of filename extensions (such as ".html") to MIME
    Content-Type values (such as text/html).

    I'd now like to determine why I'm receiving the error. The web site is
    http://www.ortonage.com. So far, I've verified that the server mime types
    are configured correctly on the web server (MS IIS). I know I'm probably
    going to get beat up because I'm using MS IIS but it has met my needs so
    far. :) I've also verified the doctype is correct <!DOCTYPE HTML PUBLIC
    "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"> and that the meta tag <META
    HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> is
    correct. I'm now at a loss on where to look next.

    The site uses a URL rewriter so even though the URL appears as static to the
    client it gets modified by the server to a dynamic URL before processing and
    responding to the client. I'm wondering if the server is not including the
    correct content-type in the header information because the ".htm" is
    stripped from the URL during processing and before the response is actually
    returned to the client side. If that is the case, any ideas on how to
    rectify the problem? I also have the meta tag equivalent in each web page
    so I thought that it might guarantee the content-type is set correctly.
    Works fine for Netscape and IE browsers. I've only seen this problem on W3C
    so far.

    Any suggestions would be very much appreciated.

    Thanks.

    Trevor Orton (www.ortonage.com)


  • Steve Pugh

    #2
    Re: W3C HTML Validator Error - Invalid content-type

    On Sat, 13 Nov 2004 00:48:06 -0500, "Trevor Orton"
    <ortonage@yahoo .com> wrote:
    [color=blue]
    >I recently validated my site's css and the bulk of the html pages via the
    >W3C validator but was forced to use the file upload option because the
    >'Validate by URL' option returns the following error:[color=green][color=darkred]
    >>>Sorry, I am unable to validate this document because its content type is[/color][/color]
    >http://www.ortonage.com, which is not currently supported by this service.
    >The Content-Type field is sent by your web server (or web browser if you use
    >the file upload interface) and depends on its configuration. Commonly, web
    >servers will have a mapping of filename extensions (such as ".html") to MIME
    >Content-Type values (such as text/html).
    >
    >I'd now like to determine why I'm receiving the error. The web site is
    >http://www.ortonage.com. So far, I've verified that the server mime types
    >are configured correctly on the web server (MS IIS).[/color]

    No they're not.

    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.0
    Date: Sat, 13 Nov 2004 06:32:48 GMT
    Set-Cookie: u=1704538305; expires=Tuesday , 11-Nov-14 06-32-48 GMT;
    path=/;
    HTTP/1.1 200 OK
    Server: Microsoft-IIS/5.0
    Date: Sat, 13 Nov 2004 06:32:48 GMT

    See? No Content-Type header at all.

    Steve

    Comment

    • Leonard Blaisdell

      #3
      Re: W3C HTML Validator Error - Invalid content-type

      In article <z4ydnQUgHPBiAw jcRVn-2g@rogers.com>, "Trevor Orton"
      <ortonage@yahoo .com> wrote:
      [color=blue]
      > Any suggestions would be very much appreciated.[/color]

      <http://www.htmlhelp.co m/tools/validator/> says everything is OK. The W3C
      validator can't parse it. I'll leave it to others to tell you why.
      You asked only for a solution to one problem. I have to tell you that from
      a design point of view, you have two.

      leo

      --
      <http://web0.greatbasin .net/~leo/>

      Comment

      • David Ross

        #4
        Re: W3C HTML Validator Error - Invalid content-type

        First of all, the validator is saying there is something wrong with
        your server, not with your page. It never even tried to validate
        your page.

        You need to have your Web host correct the server's .htaccess file
        to define a MIME type for HTML files. It's not unusual for an
        individual Web site to also have its own .htaccess file for
        esoteric MIME types; I have one. However, your Web server should
        already have HTML defined in its master .htaccess.

        However, I can tell you that you definitely have a design problem.
        A well-designed Web page should not require right-left scrolling,
        especially for text.

        --

        David E. Ross
        <http://www.rossde.com/>

        I use Mozilla as my Web browser because I want a browser that
        complies with Web standards. See <http://www.mozilla.org/>.

        Comment

        • Trevor Orton

          #5
          Re: W3C HTML Validator Error - Invalid content-type

          > >http://www.ortonage.com. So far, I've verified that the server mime
          types[color=blue][color=green]
          > >are configured correctly on the web server (MS IIS).[/color]
          >
          > No they're not.[/color]

          Ok, I'll have to dig into why IIS is not transmitting the content-type
          header even though it is configured to do so. I'm guessing that IIS is
          confused because I modify the URL before processing. The fix may be to
          force the content-type header through the dynamic page generation sequence
          instead of relying on the server.

          I assume then that the meta tag for content-type is of little value to the
          W3C validator and I assume then that the browsers must either use the meta
          tag or assume text/html in the absence of the content-type header.

          Thanks for the response Steve.


          Comment

          • Trevor Orton

            #6
            Re: W3C HTML Validator Error - Invalid content-type

            > <http://www.htmlhelp.co m/tools/validator/> says everything is OK. The W3C[color=blue]
            > validator can't parse it. I'll leave it to others to tell you why.
            > You asked only for a solution to one problem. I have to tell you that from
            > a design point of view, you have two.
            >
            > leo[/color]

            Hi Leo. Yes, I had already ran the same validator but it did not complain,
            nor did W3C when I uploaded the page source individually.

            Please comment on what you feel are design issues (even if you don't want to
            get into why or how to fix them). The site was my first attempt with css and
            compliant html so I'm not surprised you feel there are other problems. It
            seems to be rendering correctly under recent versions of IE and NS and I
            plan to do some testing with additional browsers in the future when time
            permits.

            Thanks for your time.

            Trevor


            Comment

            • Trevor Orton

              #7
              Re: W3C HTML Validator Error - Invalid content-type


              "David Ross" <nobody@nowhere .not> wrote in message
              news:419646DE.E B7432BF@nowhere .not...[color=blue]
              > First of all, the validator is saying there is something wrong with
              > your server, not with your page. It never even tried to validate
              > your page.[/color]

              Makes sense.
              [color=blue]
              > You need to have your Web host correct the server's .htaccess file
              > to define a MIME type for HTML files. It's not unusual for an
              > individual Web site to also have its own .htaccess file for
              > esoteric MIME types; I have one. However, your Web server should
              > already have HTML defined in its master .htaccess.[/color]

              I didn't know MS IIS had a .htaccess file. I thought .htaccess was used
              with linux based web servers only. My IIS GUI shows that text/html is
              configured correctly so I'll have to investigate this one further.
              [color=blue]
              > However, I can tell you that you definitely have a design problem.
              > A well-designed Web page should not require right-left scrolling,
              > especially for text.[/color]

              Yes, I used absolute positioning in my css and may have used too wide of a
              page design. Also, I have only tested it on recent versions of IE and NS so
              far so it could be brutal on other browsers at the moment and I wouldn't
              even know. I've got some work to do on that end.

              Thanks for your feedback.

              Trevor


              Comment

              • Harrie

                #8
                Re: W3C HTML Validator Error - Invalid content-type

                Trevor Orton said the following on 11/13/04 20:55:
                [color=blue]
                > "David Ross" <nobody@nowhere .not> wrote in message
                > news:419646DE.E B7432BF@nowhere .not...
                >[color=green]
                >>You need to have your Web host correct the server's .htaccess file
                >>to define a MIME type for HTML files. It's not unusual for an
                >>individual Web site to also have its own .htaccess file for
                >>esoteric MIME types; I have one. However, your Web server should
                >>already have HTML defined in its master .htaccess.[/color]
                >
                > I didn't know MS IIS had a .htaccess file. I thought .htaccess was used
                > with linux based web servers only.[/color]

                AFAIK .htaccess is specific to Apache. But Apache is not Linux based
                only, it's a cross platform web server that also runs on Windows. You
                might want to give it a try.

                --
                Regards
                Harrie

                Comment

                • Harrie

                  #9
                  Re: W3C HTML Validator Error - Invalid content-type

                  Trevor Orton said the following on 11/13/04 06:48:
                  [color=blue]
                  > The site uses a URL rewriter so even though the URL appears as static to the
                  > client it gets modified by the server to a dynamic URL before processing and
                  > responding to the client. I'm wondering if the server is not including the
                  > correct content-type in the header information because the ".htm" is
                  > stripped from the URL during processing and before the response is actually
                  > returned to the client side. [..][/color]

                  Why (stripping the ".htm" part)?
                  [color=blue]
                  > [..] If that is the case, any ideas on how to
                  > rectify the problem?[/color]

                  Maybe by not stripping the stripping the ".htm" part?

                  --
                  Regards
                  Harrie

                  Comment

                  • Brian

                    #10
                    Re: W3C HTML Validator Error - Invalid content-type

                    Trevor Orton wrote:
                    [color=blue]
                    > I didn't know MS IIS had a .htaccess file.[/color]

                    AFAIK, it doesn't.
                    [color=blue]
                    > I thought .htaccess was used with linux based web servers only.[/color]

                    No. It is used with *Apache* only, regardless of operating system. I use
                    it on Apache/Linux and Apache/Windows.

                    --
                    Brian (remove "invalid" to email me)

                    Comment

                    • Brian

                      #11
                      Re: W3C HTML Validator Error - Invalid content-type

                      Trevor Orton wrote:
                      [color=blue]
                      > I assume then that the meta tag for content-type is of little value
                      > to the W3C validator[/color]

                      Or indeed to conforming web user-agents. The meta tag hack is only
                      useful for those who want to save the page and open the local copy
                      later, perhaps when they are offline.
                      [color=blue]
                      > and I assume then that the browsers must either use the meta tag or
                      > assume text/html in the absence of the content-type header.[/color]

                      No, but they are allowed to guess if there's no content-type. Obviously,
                      there's no sense in making the ua guess if you're the author.

                      --
                      Brian (remove "invalid" to email me)

                      Comment

                      • Trevor Orton

                        #12
                        Re: W3C HTML Validator Error - Invalid content-type

                        >[color=blue]
                        > Why (stripping the ".htm" part)?[/color]

                        The server extension (dll) does not require it.

                        I had a brief look at the server side code (dll) and I think that it may be
                        deleting the content-type header (and possibly others) during the processing
                        sequence. The server itself is probably working correctly. Funny how it
                        has been like this for months and the W3C validator was the only thing that
                        complained. I'll have to debug it on my test server tomorrow.

                        Thanks everyone for your help.

                        Trevor


                        Comment

                        • Alan J. Flavell

                          #13
                          Re: W3C HTML Validator Error - Invalid content-type

                          On Sun, 14 Nov 2004, Brian wrote:
                          [color=blue][color=green]
                          > > I thought .htaccess was used with linux based web servers only.[/color]
                          >
                          > No. It is used with *Apache* only,[/color]

                          The idea derives from the NCSA HTTPD, and has been adopted by more
                          than just one HTTPD that was based on that idea. The Apache server is
                          by far the most common server which fits that description, but
                          ..htaccess isn't really exclusive to Apache.

                          Comment

                          • Harlan Messinger

                            #14
                            Re: W3C HTML Validator Error - Invalid content-type

                            "Trevor Orton" <ortonage@yahoo .com> wrote:
                            [color=blue]
                            >
                            >"David Ross" <nobody@nowhere .not> wrote in message
                            >news:419646DE. EB7432BF@nowher e.not...[color=green]
                            >> First of all, the validator is saying there is something wrong with
                            >> your server, not with your page. It never even tried to validate
                            >> your page.[/color]
                            >
                            >Makes sense.
                            >[color=green]
                            >> You need to have your Web host correct the server's .htaccess file
                            >> to define a MIME type for HTML files. It's not unusual for an
                            >> individual Web site to also have its own .htaccess file for
                            >> esoteric MIME types; I have one. However, your Web server should
                            >> already have HTML defined in its master .htaccess.[/color]
                            >
                            >I didn't know MS IIS had a .htaccess file.[/color]

                            It doesn't. Either David overlooked that you were talking about IIS,
                            or he didn't realize that .htaccess isn't common to all web servers.

                            Especially with the part about having a URL-rewriting server
                            extension, it sounds like you'll really get a better response in an
                            IIS-related newsgroup. Your problem isn't related to HTML at all.

                            --
                            Harlan Messinger
                            Remove the first dot from my e-mail address.
                            Veuillez ôter le premier point de mon adresse de courriel.

                            Comment

                            • David Ross

                              #15
                              Re: W3C HTML Validator Error - Invalid content-type

                              Trevor Orton wrote [in part]:[color=blue]
                              >
                              > I previously wrote [also in part]:[color=green]
                              > > However, I can tell you that you definitely have a design problem.
                              > > A well-designed Web page should not require right-left scrolling,
                              > > especially for text.[/color]
                              >
                              > Yes, I used absolute positioning in my css and may have used too wide of a
                              > page design. Also, I have only tested it on recent versions of IE and NS so
                              > far so it could be brutal on other browsers at the moment and I wouldn't
                              > even know. I've got some work to do on that end.[/color]

                              Don't use absolute positioning or sizing. Alternative Web browsers
                              (e.g., Web-capable cell phones) can't handle it. It also creates a
                              problem for users who don't maximize their browser windows.
                              Instead, use relative positioning and sizing.

                              --

                              David E. Ross
                              <http://www.rossde.com/>

                              I use Mozilla as my Web browser because I want a browser that
                              complies with Web standards. See <http://www.mozilla.org/>.

                              Comment

                              Working...