steveosoule
7/22/2016 - 6:19 PM

Grab Live Site files if Missing From Dev Site - htaccess

Grab Live Site files if Missing From Dev Site - htaccess

# https://stevegrunwell.github.io/wordpress-git/#/13

<IfModule mod_rewrite.c>
  RewriteEngine on

  # Attempt to load files from production if
  # they're not in our local version
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule wp-content/uploads/(.*) \
    http://{PROD}/wp-content/uploads/$1 [NC,L]
</IfModule>

# WHAT DOES IT DO?
# Does the requested file exist in the local filesystem?
#	YES: Load it as we normally would
#	NO: Attempt to load the file from production