PTED为图像,但MIME类型文本传输资源跨$ P $ / HTML错误 [英] Resource interpreted as Image but transferred with MIME type text/html error

查看:180
本文介绍了PTED为图像,但MIME类型文本传输资源跨$ P $ / HTML错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿我一直在试图显示图像到我的网页的背景,但它不工作我不断收到错误

 资源跨preTED为图像,但与MIME类型text / html转移:
http://killerducky1.x10.mx/images/offline.png。 killerducky1.x10.mx/:1
 

谷歌浏览器开发检测控制台

和它的外观就开始在行一个是

< HTML>

和我到处和couldent寻找一个解决方法除了检查文件是否存在,并将其剂量

但我没有找到的东西,说.httaccess有什么用它做这样的IM不知道它怎么一回事,因为我加入了离线/维护功能,它

.httaccess

 #-FrontPage-
RewriteEngine叙述上
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$ /profile.php?username=$1
IndexIgnore的.htaccess * /。?? *〜*#* / HEADER * * / README * * / _ VTI *
### 维护模式 ###
的RewriteCond%{REQUEST_URI} ^ /(离线\ .PHP |图片/离线\巴纽)!$
重写规则^(。*)$下线\ .PHP [L]
维护模式###结束###
<限制GET POST>
为了否认,允许
所有否认
允许所有
< /限制>
<限制PUT DELETE>
为了否认,允许
所有否认
< /限制>
AuthName指令killerducky1.x10.mx
的AuthUserFile /home/killerdu/public_html/_vti_pvt/service.pwd
目录AuthGroupFile /home/killerdu/public_html/_vti_pvt/service.grp
 

offline.php

 < HTML>
< HEAD>
    <标题>我们正处于离线状态<!/标题>
  < /头>
  <身体GT;
<风格>
体  {
    背景图像:网址(图像/ offline.png');
    背景颜色:#eee;
      背景重复:不重复;
    背景附件:固定;
    背景位置:中心;
    背景尺寸:1387px 729px;
}
< /风格>
< /身体GT;
< / HTML>
 

解决方案

您的问题是在这条线:

 的RewriteCond%{REQUEST_URI}!^ /离线\的.php $
重写规则^(。*)$下线\ .PHP [L]
 

以上告诉任何不符合 /offline.php 启动将被重定向到 offline.php ,其中包括图像。

您可以通过将其改为修复

 的RewriteCond%{REQUEST_URI} ^ /(离线\ .PHP |图片/离线\巴纽)!$
重写规则^(。*)$下线\ .PHP [L]
 

Hey there i've been trying to display a image to the background of my page but its not working i keep getting the error

Resource interpreted as Image but transferred with MIME type text/html: 
"http://killerducky1.x10.mx/images/offline.png". killerducky1.x10.mx/:1

on the google chrome dev concole

and by the looks of it it started at line one which is

<html>

and i looked everywhere and couldent find a fix besides checking if the file exists and it dose

But i did find something that said the .httaccess has something to do with it so im not sure its beacuse i added a offline/maintenance function to it

.httaccess

# -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

offline.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>

解决方案

Your issue is on this line:

RewriteCond %{REQUEST_URI} !^/offline\.php$
RewriteRule ^(.*)$ offline\.php [L]

The above tells that anything not start with /offline.php will be redirected to offline.php which includes image.

You can fix it by changing it into:

RewriteCond %{REQUEST_URI} !^/(offline\.php|images/offline\.png)$
RewriteRule ^(.*)$ offline\.php [L]

这篇关于PTED为图像,但MIME类型文本传输资源跨$ P $ / HTML错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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