【发布时间】:2014-11-01 16:21:34
【问题描述】:
嘿,我一直在尝试将图像显示到我的页面背景,但它不工作,我不断收到错误
Resource interpreted as Image but transferred with MIME type text/html:
"http://killerducky1.x10.mx/images/offline.png". killerducky1.x10.mx/:1
在 google chrome dev concole 上
从外观上看,它从第一行开始
<html>
我到处找了找,除了检查文件是否存在之外找不到修复方法
但我确实找到了一些说 .httaccess 与它有关的东西,所以我不确定它是因为我向它添加了离线/维护功能
.htt访问
# -FrontPage-
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /profile.php?username=$1
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
### Maintenance Mode ###
RewriteCond %{REQUEST_URI} !^/(offline\.php|images/offline\.png)$
RewriteRule ^(.*)$ offline\.php [L]
### end of Maintenance Mode ###
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName killerducky1.x10.mx
AuthUserFile /home/killerdu/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/killerdu/public_html/_vti_pvt/service.grp
离线.php
<html>
<head>
<title>We are offline !</title>
</head>
<body>
<style>
body {
background-image: url('images/offline.png');
background-color: #eee;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: 1387px 729px;
}
</style>
</body>
</html>
【问题讨论】:
-
似乎您的 htaccess 将
offline.png重定向到offline.php这是一个文本/html 文件 -
你的意思是说我的浏览器正在将
offline.png读取为文本文件? -
也许
AddType image/png .png不见了? -
不,仍然出现错误
-
感谢您的帮助!但还是没有解决