[HTML/Firefox]: When website opens, Firefox asks to download the page
My website is working fine on IE, but when I open it on Firefox, Firefox asks to download the same page and opens the Downlo开发者_StackOverflowad File dialog. This problem occurs sometimes in Safari also.
For example, if I type in the URL as:
http://www.example.com/news.html
Firefox opens a dialog to download "news.html". Whereas, it works fine in IE. Why?
This appears to be a problem with the MIME type being sent by your server in the HTTP header. If you are using PHP, check for any header() calls being sent before the page is echoed.
Also, try sending an explicit HTTP header like this:
<?php
header ("content-type:text/html");
.... HTML / BODY / echo starts here
....
?>
Does your web.xml
define mime types like the following?
<mime-mapping>
<extension>.html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
As some other answers suggest, this has to do with the Content-Type being sent. Using the addon Live HTTP Headers, you will be able to check which are sent. It should be text/html.
精彩评论