Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 背景消失。htaccess_.htaccess_Background_Styles - Fatal编程技术网

.htaccess 背景消失。htaccess

.htaccess 背景消失。htaccess,.htaccess,background,styles,.htaccess,Background,Styles,我刚刚完成了我的.htaccess文件,只是重写到了一个更好的URL,但是没有理由背景消失了。如果我使用丑陋的旧URL访问,背景就在那里 <html... ... <style type='text/css'> body { color:#FFF;background:#444 url(office_1.png); } body { margin:0;padding:0; } </style> </head> .htaccess规则正在运行,但为什么我

我刚刚完成了我的
.htaccess
文件,只是重写到了一个更好的URL,但是没有理由背景消失了。如果我使用丑陋的旧URL访问,背景就在那里

<html...
...
<style type='text/css'>
body { color:#FFF;background:#444 url(office_1.png); }
body { margin:0;padding:0; }
</style>
</head>

.htaccess
规则正在运行,但为什么我的背景消失了?

URI是相对的,因此它正在查找中的图像

/your/nice/uri/office_1.png
不在

/office_1.png
通常的修复方法是使用/启动映像路径,正如我在上面的示例中所做的那样,使其相对于站点的根

url(/office_1.png);
url(/office_1.png);