Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

CSS rewrite not working

Started by Muut Archive 10 years ago · 8 replies · 493 views
10 years ago

Hi, I seem to stumble across many issues in the current project im working on, that I can't even replicate on other grav installations.

For some reason the relative urls in my CSS files are not being rewritten, even tho its enabled.

If i enable CSS pipelining and CSS rewrite the output for any background image in my css follows the following path/pattern.

TXT
grav/images/cd-top-arrow.svg

whereas it should be

TXT
grav/user/themes/themename/images/cd-top-arrow.svg

The moment i turn off CSS pipelining its working fine again.

I tried to replicate this on 2 different grav installations that i have running and there it works fine.

anyone else had this problem?

10 years ago

I never used CSS rewrite but isn't it a special option for windows webhost? What is happening when you just turn on CSS pipeline without CSS rewrite?

10 years ago

Pipeline without CSS rewrite results in the img path being incorrect.

Normally, to my understanding, the CSS rewrite would rewrite the URL to a path that is correct. At least that how it works on my other installations.

The problem I have now is that with Pipeline enabled the image path breaks. And enabling CSS rewrite doesn't seem to do anything at all.

I believe the windows webhost specific setting you refer to is "CSS minify Windows override", but I have not enabled that setting.

10 years ago

ohh, right, I got confused between the two options. Maybe a temporary fix is adding {{ theme_url }} before your url

10 years ago

You should use relative URLs in your CSS. Such as:

TXT
../images/cd-top-arrow.svg

These should be processed correctly.

10 years ago

The URL in the CSS is relative, and works as it should. The problem surfaces once I enable CSS pipeline.

e.g.

TXT
background: #fff url('../images/menubg.jpg') no-repeat;

results in:

TXT
grav/images/menubg.jpg

should have been:

TXT

grav/user/themes/themename/images/menubg.jpg
---
10 years ago

Hi Rhukster, I just double checked it again on a different installation, same server etc. where it's working. The relative URL is rewritten and the output is correct.

Could there be any other setting that influences this?

10 years ago

I can't really say for sure what the cause is unless i can try to recreate it myself. If you open an issue and attach a copy of your user/ folder, i can do so.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1124 9 years ago