2

I have a project on domain example.com all css files for this project are getting from cdn.example.com in this css files I used only relative paths e.g.

  background:url(../../images/colorbox/loading.gif) no-repeat center center;

Due to this path for images should be cdn.example.com/../../images/....

But all images are loading from example.com/... not cdn. Is there any advices, For loading images from cdn?

Community
  • 1
  • 1
Nikita Platonenko
  • 702
  • 1
  • 7
  • 13
  • 2
    don't use relative paths? – Prisoner Jan 09 '13 at 14:34
  • cant you use background:url(http://cdn.example.com/images/colorbox/loading.gif)? – Chanckjh Jan 09 '13 at 14:35
  • 4
    cdn.example.com and example.com are basically two different domains, so you can't use relative paths – Ronald Borla Jan 09 '13 at 14:36
  • I Guess your css file cached –  Jan 09 '13 at 14:38
  • css files are loading from from cdn. I know that cdn.example.com and example.com are different domains, so i need images will be loading from same domain as css, so i used relative pathes. css file is too large to change for a absolute urls, and if cdn will change to other name – Nikita Platonenko Jan 09 '13 at 14:50
  • could you show the working url? – jpganz18 Jan 09 '13 at 14:58
  • Look at the source of your CSS file and make sure that once the file is actually up on CDN, all the paths are relative. If they are NOT relative (and are set to example.com/../../images/...) you will need to log into your CDN control panel and find out what settings are causing the CSS file to be re-written. This is a feature some CDN's have so you don't have to change your CSS files by hand should you need to reference things that used to be called relatively before you went to CDN. – Jack Jan 09 '13 at 21:36

0 Answers0