css - 重定向后我的横幅未显示

标签 css .htaccess

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

相关文章:

javascript - 如何防止元素退出或跳出页面?

css 预代码突出显示在 Atom 中不起作用

javascript - 在 HTML 表 : How To Manage Tables Row Height? 中

apache - 使用 .htaccess 使用 SSL 将 domain.com 重定向到 www.domain.com

css - 我应该使用最大设备宽度还是最大宽度?

html - 如何从 Firefox 中的选择元素中删除箭头

.htaccess - 从 SEO 友好 URL 中删除 id/variable

.htaccess - htaccess mod重写,即使文件夹存在

.htaccess - 1and1子目录cakePHP安装问题

.htaccess 使用共享 ssl 证书