Skip to content

Instantly share code, notes, and snippets.

@webworthydesign
Forked from stevegrunwell/.htaccess
Created March 4, 2017 21:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webworthydesign/bdbb580e94605c442315ad5c43f11bd4 to your computer and use it in GitHub Desktop.
Save webworthydesign/bdbb580e94605c442315ad5c43f11bd4 to your computer and use it in GitHub Desktop.
Load production WordPress uploads in a local version of the site by putting this in a new Htaccess file in /wp-content/uploads/
# Attempt to load files from production if they're not in our local version (replace {SITE URL} with your production server)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://{SITE URL}/wp-content/uploads/$1
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment