For some of my larger WordPress sites, I would like to avoid having to copy all the media files from the live site to the development site, but instead point the development site to use the media files from the live site.

On Drupal there is a great module for this called Stage File Proxy: https://www.drupal.org/project/stage_file_proxy

How can I do it with Wordpress?


Looks like there is an equailent plugin in wordpress https://github.com/alleyinteractive/stage-file-proxy . I have noted tested it but going to do soon , Will update


I have had good luck with this plugin https://wordpress.org/plugins/uploads-by-proxy/

However, if you want to take a straight server-based approach, there is one highlighted here in this blog post:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f [NC]
    RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) http://example.com/$1 [NC,P,L]

Put this at the top of your .htaccess before any other rules and replace example.com with the URL of your live server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.