pages are displaying plain text instead of html

微笑、不失礼 提交于 2019-11-29 14:42:04

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.

Areeb Soo Yasir

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

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?

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!