Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

Google Chrome doesn't render .xhtml file when I response:

http://localhost:56685/simple/OPS/cover.xhtml 

But when I use file protocol it renders sucessfully:

file:///C:/Users/Kosha/Downloads/cover.xhtml

Is not a problem with bad url as the browser starts downloading the document to hard disk.

<?xml version="1.0" encoding="UTF-8"?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title/>
    <link rel="stylesheet" href="style.css" type="text/css"/>
    <link rel="stylesheet" href="style.css" type="text/css"/>
    </head>
    <body class="cover">
    <svg xmlns="http://www.w3.org/2000/svg" class="cover-svg" viewBox="0 0 391 600">
    <image height="600" xlink:href="images/cover.jpg" width="391" xmlns:xlink="http://www.w3.org/1999/xlink"/>
    </svg>
    </body>
    </html>
share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Tog, Shekhar, Moses, davidgo Jan 8 at 7:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
@techie007, that question was about the file using a wrong DOCTYPE, if that were the case here, it should not work when loading locally either (especially since Chrome doesn’t have any sort of “quirks-mode”). –  Synetech Jan 4 at 18:41

1 Answer 1

The most likely problem is with your HTTP server providing the wrong Content-Type for the file.

Some servers will claim that all files with unrecognized extensions are of type application/octet-stream, so you need to configure yours to use application/xhtml+xml for .xhtml files. (Meanwhile, .html would use text/html.)

$ telnet superuser.com 80 Enter ↵
HEAD / HTTP/1.0 Enter ↵
Host: superuser.com Enter ↵
Enter ↵
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.