Skip to content

Instantly share code, notes, and snippets.

@kfriend
Created April 8, 2015 22:19
Show Gist options
  • Save kfriend/af101ac05651cefac3f0 to your computer and use it in GitHub Desktop.
Save kfriend/af101ac05651cefac3f0 to your computer and use it in GitHub Desktop.
Apache: Redirect missing WP uploads to production server (via .htaccess)
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) http://www.production.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment