Skip to content

Instantly share code, notes, and snippets.

@pudgereyem
Last active December 16, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pudgereyem/5378742 to your computer and use it in GitHub Desktop.
Save pudgereyem/5378742 to your computer and use it in GitHub Desktop.
Apache: .htaccess assets redirect development -> production
# Attempt to load files from production if they're not in our local version
# If you have development/production setup, it's neat to use .htaccess to redirect all failed requests to the production server (since we wont want to sync all the uploaded media between the two)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://yourlivesite.com/wp-content/uploads/$1
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment