Up! Any news?
It is crippling.
Thanks. TC
Looks like this is still a problem. Anyone have a fix?
You can use the CDN Linker in combination with W3TC
https://github.com/wmark/CDN-Linker
Hey everyone,
I came up with a quick fix. Feel free to implement it until the plugin author publishes an update.
In plugins/wp3-total-cache/lib/W3/Plugin/Cdn.php line 1008 change the following code:
if (preg_match('~' . $domain_url_regexp . '~i', $baseurl)) {
$regexps[] = '~(["\'(])\s*((' . $domain_url_regexp . ')?(' . w3_preg_quote($upload_info['baseurlpath']) . '([^"\')>]+)))~';
} else {
$parsed = @parse_url($baseurl);
To:
if (preg_match('~' . $domain_url_regexp . '~i', $baseurl)) {
$regexps[] = '~(["\'(])\s*((' . $domain_url_regexp . ')?(' . w3_preg_quote($upload_info['baseurlpath']) . '([^"\')>]+)))~';
// This will correct up to 10 media urls within a html attribute (srcset for example)
for ( $i = 0; $i < 10; $i++ )
$regexps[] = '~([(, )"\'(])\s*((' . $domain_url_regexp . ')?(' . w3_preg_quote($upload_info['baseurlpath']) . '([^"\')>]+)))~';
} else {
$parsed = @parse_url($baseurl);
just rememebr to deactivate and reactivate the W3TC plugin after making the change
M3
(@emmtre)
@ardalanme Many thanx for the fix. From my testing it looks like it’s working.
This works for me! Thank you!
Does anyone have any idea if this issue has been fixed on W3TC’s side? I.e. W3TC can be used with Cloudfront without having to do the fix mentioned above?
Hello rmkahler
I can confirm the changes are not added in the W3TC yet, so you still have to make the changes yourself. And if the changes are not added in next update, after updating you have to add it again.
Have a good day!
Cheers
Ash