pages are displaying plain text instead of html

前端 未结 4 1920
盖世英雄少女心
盖世英雄少女心 2020-12-21 01:46

I am hosting multiple sites on the same server and using a http-vhosts file to specify virtual host info for them. It is working great. The problem is I changed in Movable T

相关标签:
4条回答
  • 2020-12-21 02:18

    Is it possible that this is a content negotiation problem? In a few cases I've seen Apache try to determine what sort of file is being requested by looking at the first few bytes of the file being served.

    I have seen problems like this be solved by commenting out mod_negotiation in http.conf and restarting. See the mod_negotiation documentation for more details.

    0 讨论(0)
  • 2020-12-21 02:21

    I just solved the same issue by disbabling Magic Mime in httpd.conf (some files would display as html and some as text for no apparent reason).

    edit /etc/httpd/conf/httpd.conf

    Comment the lines for the Mime Magic Module:

    MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
    

    Restart Apache and clear your browser cache

    source

    0 讨论(0)
  • 2020-12-21 02:23

    That seems correct. Care to share one link, or the HTTP headers that are returned for one of those pages? P.S. as well as the whole Apache config block where you placed that directive, for context?

    0 讨论(0)
  • 2020-12-21 02:24

    if u create a .htaccess in ur site's root dir,and the .htaccess's content is: DefaultType text/html then the issue is fixed imm.

    0 讨论(0)
提交回复
热议问题