Last active
May 30, 2024 17:09
-
-
Save viktorbijlenga/e024a4fb414d17b875a9bb09a84f0eb9 to your computer and use it in GitHub Desktop.
load images from a different Wordpress enviroment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place above all other rewrite rules if using a CMS or program that redirects all request to index.php file (e.g. WordPress, Drupal, Laravel, etc...) | |
# if a file or directory does not exist on the local host, 302 redirect the request to the production host so the browser doesn't cache the file in case you replace the file locally | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Redirect WordPress uploads | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule wp-content/uploads/(.*)$ http://REPLACEWITHYOURDOMAIN.COM/wp-content/uploads/$1 [R=302,L,NC] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment