WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
Relative image paths incorrect in minified CSS (5 posts)

  1. matt_d_rat
    Member
    Posted 2 years ago #

    Hi, I am looking at implementing W3 Total cache on our site, but am running into some issues with relative image paths not being converted properly during the CSS magnification.

    My theme (for simplification lets call it "Hello World 2011") folder structure is as follows:

    - style.css
    |
    |-- styles
    |    |- reset.css
    |    |- template.css
    |
    |-- images
          |- foo.jpg
          |- bar.jpg

    So the paths to images in template.css are referenced as:
    url('../images/foo.jpg')

    and image paths in style.css are referenced as:
    url('images/bar.jpg')

    But when the css is minified I am getting the following paths to images generated:

    url('oworld_theme/themes/helloworld2011/oworld_theme/themes/helloworld2011/oworld_theme/themes/helloworld2011/images/foo.jpg')

    What do I need to do in order to fix this issue?

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. matt_d_rat
    Member
    Posted 2 years ago #

    Update: I have discovered what the issue is, but have no idea how to resolve it.

    Basically we symlink the themes folder to another folder located at:

    /home/username/www/www/helloworld_theme/themes/ as we use Git to manage our theme development. (Don't ask why it is set up this way, I didn't set it up :-S)

    It seems during the minification the plugin is getting confused when following the path to the symlink on the server, which ends up lopping off the first part of the path and then adding an additional path to the end to form something like:

    url('oworld_theme/themes/helloworld2011/oworld_theme/themes/helloworld2011/oworld_theme/themes/helloworld2011/images/foo.jpg')

    for the image paths in the css. Does anyone have any ideas what might be causing the plugin to do this, and how I can resolve it?

  3. matt_d_rat
    Member
    Posted 2 years ago #

    Any one? Still having this issue which I desperately need to resolve in order to use this plugin.

  4. cyonite
    Member
    Posted 2 years ago #

    Think symlinks should work in latest version or try development version. I had similar problem with symlinks as well a 1 year ago. If its still an issue and you haven't already can you please submit a bug submission form from the support tab of the plugin because we are unable to duplicate and need to learn more?

  5. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    @matt_d_rat, let me know if this was helpful please.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic