Title: loboyle's Replies | WordPress.org

---

# loboyle

  [  ](https://wordpress.org/support/users/loboyle/)

 *   [Profile](https://wordpress.org/support/users/loboyle/)
 *   [Topics Started](https://wordpress.org/support/users/loboyle/topics/)
 *   [Replies Created](https://wordpress.org/support/users/loboyle/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/loboyle/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/loboyle/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/loboyle/engagements/)
 *   [Favorites](https://wordpress.org/support/users/loboyle/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[WP REST JMESPath] Super Fantastic!](https://wordpress.org/support/topic/super-fantastic-3/)
 *  Plugin Author [loboyle](https://wordpress.org/support/users/loboyle/)
 * (@loboyle)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/super-fantastic-3/#post-8076447)
 * Great, glad it was helpful.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[W3 Total Cache] W3TC, Subdirectory WP Install and CDN wp-includes uploads](https://wordpress.org/support/topic/w3tc-subdirectory-wp-install-and-cdn-wp-includes-uploads/)
 *  Thread Starter [loboyle](https://wordpress.org/support/users/loboyle/)
 * (@loboyle)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/w3tc-subdirectory-wp-install-and-cdn-wp-includes-uploads/#post-6247876)
 * Hi,
 * Sorry for the delay, went on holiday just after asking this 🙂
 * I had dived in to the W3TC code and what it’s doing is just mirroring the local
   filesystem structure up in to S3; because the files are located on the server
   under /wp/whatever, it gets put up to S3 as /wp/whatever. It’s not checking the
   siteurl or home parameters at all (it generally wouldn’t need to). Makes sense
   and W3TC has no way of knowing that I’m rewriting the requests.
 * A fix could be made to to W3TC to try to incorporate some logic there, but I 
   haven’t had much luck asking for some badly needed fixes in the past so won’t
   hold out much hope 🙂
 * I’d seen the gist that you point to, but it’s doing the exact opposite of what
   I actually want. I’m trying to hide the /wp/ subdirectory, not force it back 
   in again!
 * However, I did find a reasonably straightforward workaround when I looked at 
   again after a month of rest. Let W3TC push the upload into S3 under the subdirectory/
   wp/, then just move the files in S3 to remove the subdirectory prefix. All of
   the rest of the rewriting then works fine, you just need to remember to do this
   any time you upgrade your WP version and have W3TC push up the includes to S3.
 * To illustrate this new flow (changes to the above in bold)
    1. in my root, I have the file /wp/wp-includes/js/heartbeat.js
    2. W3TC uploads this to the CDN at /wp/wp-includes/js/heartbeat.js
    3. **In S3 manually move /wp/\* to /**
    4. WP enqueues the script as /wp-includes/js/heartbeat.js because the /wp/ is not
       in the siteurl (deliberately, because we’re rewriting this)
    5. W3TC scans the output from WP and rewrites the link to the CDN at /wp-includes/
       js/heartbeat.js **which now works because we’ve moved the synced files**

Viewing 2 replies - 1 through 2 (of 2 total)