嘿,我一直在尝试将图像显示在我的页面背景中,但它不起作用我不断收到错误
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与它有关的内容所以我不确定它是否因为我添加了离线/维护功能
.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>
答案 0 :(得分:1)
您的问题就在这一行:
RewriteCond %{REQUEST_URI} !^/offline\.php$
RewriteRule ^(.*)$ offline\.php [L]
以上说明任何不以/offline.php
开头的内容都会被重定向到包含图片的offline.php
。
您可以通过将其更改为:
来解决此问题RewriteCond %{REQUEST_URI} !^/(offline\.php|images/offline\.png)$
RewriteRule ^(.*)$ offline\.php [L]