WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Bug in "Replace domain in URL with:" ? (4 posts)

  1. djstelios
    Member
    Posted 4 years ago #

    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.

  2. Frederick Townes
    Member
    Posted 4 years ago #

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

  3. djstelios
    Member
    Posted 4 years ago #

    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.

  4. Frederick Townes
    Member
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic