Hello Guys,
I have a funny issue going on. So i have ran yarn build:production. everything is working fine on the local dev site which I have up and running which is on trellis/vagrant
Looking at the source code I can see all files now referenced with hashes.
I uploaded to the server and I have an issue.
It relates to the logo in the header. I am using css to display the logo which is:
.brand {
background-image: url(/app/themes/MYTHEME/dist/images/Logo_d5e67882.svg);
background-repeat: no-repeat;
background-size: auto auto;
background-size: contain;
display: block;
float: left;
height: 60px;
text-indent: -9999px;
width: 250px;}
This is exactly the same on the dev site and it shows the logo. however, on the production site, it doesn’t show and I get the message that ‘image could not be loaded’ when inspecting the element!
I have set the image in the header as indicated by the docs:
.background {
background-image: url(../images/image.jpg);
}
I have ran yarn build:production a few times but its the same result. it doesn’t show the image: image could not be loaded.
When I try to view the image in new browser window its the same result. I get a 404 not found.
I then moved the image to the root of the site and changed the location in the inspector to call the image from root and it works. I can also view the image in a new tab with no issues.
Seems like it’s not having it from the theme or theme css…
can anyone shed some light on why this is happening?
FYI its a a new WP build with the following .htacces file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
#RewriteRule ^plugins/(.*) /app/plugins/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
also not sure if this line still needs to stay in as it was part of an old roots theme inclusion:
#RewriteRule ^plugins/(.*) /app/plugins/$1 [QSA,L]
i have commented it out for time being not sure if it needs to stay in or not!