Last active
March 11, 2023 09:58
-
-
Save luiseduardobraschi/f3f8c95183510a0308df2f98117662c4 to your computer and use it in GitHub Desktop.
.htaccess - Load image from WooCommerce (WordPress, actually) production site if image not found in test env.
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
# You must place it above the "# BEGIN WordPress" comment. | |
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
# Just change the URL to your liking. | |
RewriteRule ^(.*)$ https://www.production-site.com/wp-content/uploads/$1 [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment