Proxying Requests to /wp-content/uploads/ to a Production Site

Hi Timothy,

I actually found a simpler way to do this using 3 WordPress filters. We can check if the file in the uploads directory exists locally and if it does don’t change anything. But if the file doesn’t exist in the uploads directory then we can replace it with a different URL and serve the media file that way.

Works well for local development without having to download a complete copy of the production site’s uploads directory.

Here it is as a gist: https://gist.github.com/kingkool68/d5e483528a260e5c7921afb5c88bffd6

1 Like