header(“Content-type: text/css”); is working in Firefox and Chrome, but in Internet Explorer 9 it shows up as 'text/html'

前端 未结 8 1044
时光取名叫无心
时光取名叫无心 2020-12-01 09:12

header(\"Content-type: text/css\"); works in Firefox, Chrome and other, but not in Internet Explorer 9. I am not sure what\'s up.

In Chrome an

8条回答
  •  离开以前
    2020-12-01 10:00

    For Internet Explorer 9 serving HTTP 406 status code in the response header for a dynamically generated CSS file we:

    1. Removed the Apache mod_negiotiation module or added -Multiviews to the host configuration (or .htaccess).
    2. Activated Apache mod_rewrite
    3. Added a rewrite rule to the virtual host configuration or htaccess:

      
      

    Note: This solution is only good for servers/virtual-hosts not using Multiviews as removing mod_negotiation removes usage of this directive as well.

提交回复
热议问题