atopps
Forum Replies Created
-
Here’s the full solution (until the next update) thanks to finglandj, as posted here (http://wordpress.org/support/topic/w3tc-is-discarding-directory-structure-when-using-cdn?replies=3)
The problem is occurring because of an erroneous replacement.
There is a script:
(function(){ var srcStrt = "http://cdn10.brovadoweddings.com/blog/wp-content/uploads/p4/images/", bioData = [{"filename":"biopic1_1303345244.jpg","url":""},{"filename":"biopic2_1303345256.jpg","url":""},{"filename":"biopic3_1303345281.jpg","url":""},{"filename":"biopic4_1303345304.jpg","url":""}], picNum = Math.floor(Math.random()*(bioData.length)), markup = '<img id="biopic" src="'+srcStrt+bioData[picNum].filename+'" width="260" height="390" alt="MN Wedding Photography | Minneapolis Wedding Photographers | Engagement Photographer bio picture" class="bio-col" />'; if ( bioData[picNum].url ) { markup = '<a href="'+bioData[picNum].url+'">'+markup+'</a>'; } document.write(markup); })();srcStart is getting modified by uri_to_cdn_uri which trims the trailing slash.
uri_to_cdn_uri is in w3-total-cache/lib/W3/Plugin/CdnCommon.php
Lines 544 and 550 trim slashes from the returned url. Changing those to an ltrim ensures the directory structure is maintained.Thanks Frederick. I did submit a bug report with the exact same issue about a week ago when I originally posted this.
I found the issue in the lib/W3/plugin/CdnCommon.php file – thanks to this thread:
http://wordpress.org/support/topic/w3tc-is-discarding-directory-structure-when-using-cdn?replies=3lines 544 and 550 of that file trim the URL. If you change the trim function to an ltrim function, that fixes the issue.
Forum: Plugins
In reply to: [W3 Total Cache] W3TC is DISCARDING Directory structure when using CDNThanks! I was looking for this exact fix as well!