Created
December 6, 2023 13:25
-
-
Save lilumi/540a8ad329cc7d45818da8da5d8f878c to your computer and use it in GitHub Desktop.
Apache, WP, get file from uploads from production site if doesn't exists on local 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
## get file from production if doesn't exist on dev environment | |
RewriteCond %{HTTP_HOST} =site1.xyz | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} .(gif|jpe?g|png|bmp|tiff|xcf|psd|ico|svg|pdf|mp4)$ [NC] | |
RewriteRule ^(.*)$ https://www.productionsite.com/$1?from=dev [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment