<div id="background"></div>
<style>
#background{
background-image: url('/banner.png');
background-size: contain;
background-repeat: no-repeat;
height: 100%;
width: 100%;
}
</style>
所以这是我的构造文件,我想向所有访问我网站的人展示这里是我的 htaccess
Options ALL -Indexes
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !=1.3.3.7
RewriteCond %{REQUEST_URI} !=/construction.php
RewriteRule .* /construction.php [L]
我还没有使用我的 IP,因为我想测试它会如何看待访问我网站的人。
网站加载正确,图像路径正确,但网站仍然是空白的。
最佳答案
不重写图像:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !=1.3.3.7
RewriteCond %{REQUEST_URI} !=/construction.php
RewriteCond %{REQUEST_URI} !\.(?:gif|png|jpg|jpeg)$ [NC]
RewriteRule .* /construction.php [L]
关于css - 重定向后我的横幅未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33066187/