页面显示纯文本而不是 html [英] pages are displaying plain text instead of html

查看:41
本文介绍了页面显示纯文本而不是 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一台服务器上托管多个站点,并使用 http-vhosts 文件为它们指定虚拟主机信息.它工作得很好.问题是我在 Movable Type 中更改了条目的创建方式.我希望他们没有文件扩展名.所以它当前是 domain.com/entry/15 而不是 domain.com/entry/15.html.因为我取出了 .html 我假设 apache 不知道该怎么做,所以它以纯文本形式吐出页面.我怎样才能解决这个问题?我添加了一个虚拟主机块:

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 Type the way entries are created. I want them to not have file extension. So it is currently domain.com/entry/15 instead of domain.com/entry/15.html. Because I took out the .html I'm assuming apache doesn't know what to do so it is spitting out the page as plain text. How can I fix this? I added in a virtualhost block:

DefaultType text/html

我还在 httpd.conf 中添加了这一点,希望它能为我的所有站点全局修复它.我重新启动了apache,仍然是同样的问题.有什么想法吗?

I also added that in the httpd.conf hoping it would fix it globally for all my sites. I restarted apache and still the same problem. Any ideas?

推荐答案

这可能是内容协商问题吗?在某些情况下,我看到 Apache 尝试通过查看所提供文件的前几个字节来确定请求的是哪种类型的文件.

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.

我见过这样的问题可以通过在 http.conf 中注释掉 mod_negotiation 并重新启动来解决.有关详细信息,请参阅mod_negotiation 文档.

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.

这篇关于页面显示纯文本而不是 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆