Jump to content
qcweb

Absolute images paths and CSS compression

Recommended Posts

Hi there,

 

For a online catalog, I modified and customized the default Prestashop theme in order to make it looks like the main website. Because the catalog is on a sub-domain, unlike the main website, I used the full path for the main layout images, in order to avoid having duplicates and avoid our visitors to load twice the exact same images twice when they are coming from the main website and vice versa.

 

However, there is a problem when CCC is enabled for CSS. Every url() properties are modified so it adds the full path to the theme images folder (which I think is a bit stupid; if ones care about minifying and compressing the CSS files, it makes no sense using longer image URLs than those in the original, uncompressed CSS, which uses relative paths...)

 

 

So, in the case layout images being linked to the main website, the online store URL is added before. In the end, I get broken links, something that looks like this:

background-image:url(http://shop.example.com/themes/prestashop/css/http://www.example.com/images/image.png);

 

 

So as for now, I need to disable CSS compression, even thought everything else is compressed, which is kind of disappointing.

 

So, is there any way to prevent Prestashop from adding the full paths in the images? Or otherwise, any way to fix my issue without duplicating all my layout images?

 

Thanks in advance!

  • Like 1

Share this post


Link to post
Share on other sites

I am having the same exact problem. This issue is preventing me from storing images in a sub-domain or any other domain for that matter. I have rebuilt the htaccess file and tried most combos in the performance section of the admin area.

Share this post


Link to post
Share on other sites

Just updated from 1.4.7 to 1.5.3 and was disapointed to see that the issue is still present... :huh: I'm looking for a way to edit the PHP files so it will keep the relative path (again, that is very retarded, why using longer URLs in a minified CSS file?). I don't really know where to look tough..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More