WordPress.org

Support

Support » Plugins and Hacks » [Plugin: W3 Total Cache] Bug in “Replace domain in URL with:” ?

[Plugin: W3 Total Cache] Bug in “Replace domain in URL with:” ?

  • Stelios
    Participant

    @djstelios

    I use FTP CDN to host the wp-includes and theme files.
    Also, I’m already using the same CDN to host my images and videos.
    The URL of the CDN is in the format cdn.mydomain.com and the blog is http://www.mydomain.com

    The problem is the plugin is trying to replace the files under http://cdn.mydomain.com, resulting a bad url in the format “http://cdn.mydomain.com/replace_domain_in_url/http://cdn.mydomain.com/images/….” !!!

    I partially fixed the issue by adding

    if (strpos($matches[4], 'http://') === 0) {
                return $matches[0];
    }

    at Cdn.php but then the plugin lose some normal replacements of wp-includes and themes directory.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Frederick Townes
    Member

    @fredericktownes

    Have you unchecked the options: “Host wp-includes/ files” and “Host active theme files”?

    Stelios
    Participant

    @djstelios

    No, because I want to use the CDN to serve the theme and wp-includes files!
    In fact, I’m so thrilled of the plugin than I’m also trying to find a solution (reading the code) to use the CDN for the .js .css and image files of plugins directory.

    Frederick Townes
    Member

    @fredericktownes

    The reason why I asked, is because if you have hard-coded URI’s to your CDN the plugin cannot deal with them. All URIs would need to be local for the plugin to “redirect” them in the final HTML output.

    I’m so thrilled of the plugin than I’m also trying to find a solution (reading the code) to use the CDN for the .js .css and image files of plugins directory.

    Use custom files input box and use a regular expression if necessary for any other special cases. But in general you will want to minify those files so that their combined, optimized and sent with better headers.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: W3 Total Cache] Bug in “Replace domain in URL with:” ?’ is closed to new replies.