CQ Bug : CSS ClientLib and Protocol Relative URLs | Community
Skip to main content
Level 4
October 16, 2015
Solved

CQ Bug : CSS ClientLib and Protocol Relative URLs

  • October 16, 2015
  • 2 replies
  • 1175 views

Hi all,

 

I am using protocol relative URL in my CSS file and managing the CSS file using CQ ClientLib. "//" is getting coverted to "../../" by CQ when i hit the CSS file.

 

For example:

In my CSS I have a line like

background-image: url("//server.com/is/image/brandBar-sprite.jpg");

 

When we hit the final CSS the "//" get converted to "../../"

background-image: url("../../server.com/is/image/brandBar-sprite.jpg");

 

Read on one blog that this is CQ defect and to fix this we need to add "absolute:" before "//" so that CQ ignore the URL.

background-image: url("absolute://server.com/is/image/brandBar-sprite.jpg");

 

I came across this link for the resolution of this issue

AEM's CSSFileBuilder vs. Protocol-relative paths in ClientLibs

 

I donot want to put "absolute:" because UI team is also working and they are supplying the CSS file. I do not want to update the CSS file. Want to get rid of this manual step. Need some other solution .Just wondering if there is another solution for same issue.

 

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mshaji

You can try pagespeed css rewrite filter

https://developers.google.com/speed/pagespeed/module/filter-css-rewrite

2 replies

MshajiCommunity AdvisorAccepted solution
Community Advisor
October 16, 2015

You can try pagespeed css rewrite filter

https://developers.google.com/speed/pagespeed/module/filter-css-rewrite

Level 4
October 16, 2015

Thanks Mshajiahmed for your reply. Can you give one example configuration how this will work in my case.