static file domain does not work with relative path CSS fonts
-
I have a domain called https://benbere.org which on the server point to absolute path
/var/www/benbere/
when I setup a static domain using
define(“WP_CONTENT_URL”, “https://static.benbere.org”);
the domain points to absolute path
/var/www/benbere/wp-content
The CSS that gets loaded for the sprite font uses a relative path, when using this on its own domain, works fine. But when using the WP_CONTENT_URL that does not have the wp-content in the url, it screws up.
i.e. without autoptimize
src: url(../fonts/spritefont.woff)
with autoptimize becomes
src: url(//static.benbere.org/wp-content/themes/cv_parent_2018/../fonts/spritefont.woff)
This would be OK if the wp-content part was not in the URL, or if it allowed the relative path to stay.
I’ve tried setting the CDN url to be https://static.benbere.org without success, and also excluding the font CSS file from autoptimize, which works just fine but causes an extra connection….
Could you tell me what filter the code uses generate this url prefix for CSS fonts? I think its going to be best if I adapt that filter from within my theme.
The page I need help with: [log in to see the link]
- The topic ‘static file domain does not work with relative path CSS fonts’ is closed to new replies.