搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Images are not loading from initial domain when using a cdn

  • 6 个回答
  • 3 人有此问题
  • 281 次查看
  • 最后回复者为 pixecs

more options

Hello, i have a wordpress website on which i set the w3 total cache plugin with a cdn, the cdn is MaxCDN and is configured to not serve images but only css & js & font files. Because i configured the cdn not to serve images, the images in css files have the src as absolute path, path which point to original website domain, something like this: background-image: url("http://www.originaldomain.com/images/back.jpg");, the css file is served from the cdn like this: http://cdn.originaldomain.com/css/style.css . So the problem is that firefox refuse to load the images referred in style.css file, images which probably appear to be in another domain. If i try to load the images directly in browser, using address bar, they are loading ok, but on loading from css file i got a http error 500 (acording to firebug). The same website is loading ok in other browsers: ie7/ie8/ie9, opera, safari and chrome. Can anyone help me to solve the issue?

被采纳的解决方案

I finally managed to fix the issue: the problem was a rewrite rule on .htaccess which redirected the request to a nonexistent file when the referer was not in the white list. The thing which pointed me on the wrong direction was the fact that other browsers happily displayed the images, probably by sending as referer the original domain name, not the cdn domain name, and so the rule was never kicking in for them. Thank you for support.

在上下文中阅读这个答案 👍 1

所有回复 (6)

more options

Disable W3cache for Admin and check it out...

Reload the webpage while bypassing the cache using one of the following steps:

  • Hold down the Shift key and click the Reload button with a left click.

OR

  • Press Ctrl + F5 or Ctrl + Shift + R (Windows and Linux)
  • Press Command + Shift + R (Mac)

Let us know if this solves the issues you are having.

more options

Hello, i already have a exception in w3 cache plugin for admin users (to bypass the cdn and use all files from original domain) so no problem there, the problem appear only for anonymous users, users which get the css files from cdn and the images should be loaded from original domain. Also i already tried the full page reload with no avail. The problem manifest only when the cdn is active and cdn is configured to not store website images, and appear to be something similar to same origin policy from javascript, i say this because checking in firebug i saw that the images which have as referer the cnd domain are not displayed. Thank you.

more options

Try Firefox Safe Mode to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.

(If you're not using it, switch to the Default theme.)

  • You can open Firefox 4.0+ in Safe Mode by holding the Shift key when you open the Firefox desktop or Start menu shortcut.
  • Or open the Help menu and click on the Restart with Add-ons Disabled... menu item while Firefox is running.

Once you get the pop-up, just select "'Start in Safe Mode"

If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to figure out which one. Please follow the Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems article for that.

To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.

When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.

Thank you.

more options

Hello, the problem is still present in safe mode. I also tried on 2 openSUSE 11.4 installs with Firefox 19 and the behaviour is the same - the images from original domain are not loaded when the css file is provided by cdn.

more options

You can check the Net log in the Web Console (Firefox/Tools > Web Developer;Ctrl+Shift+K).

more options

选择的解决方案

I finally managed to fix the issue: the problem was a rewrite rule on .htaccess which redirected the request to a nonexistent file when the referer was not in the white list. The thing which pointed me on the wrong direction was the fact that other browsers happily displayed the images, probably by sending as referer the original domain name, not the cdn domain name, and so the rule was never kicking in for them. Thank you for support.

由pixecs于修改