Skip to content

Instantly share code, notes, and snippets.

@simonlk
Last active November 28, 2016 08:50
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 simonlk/8856fc749b544de5a3ed08aca9e3b0f6 to your computer and use it in GitHub Desktop.
Save simonlk/8856fc749b544de5a3ed08aca9e3b0f6 to your computer and use it in GitHub Desktop.
WordPress load uploads from external website.
# Create .htaccess file within /wp-content/uploads/ and add the below code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} http://dev.example.com # Only perform on dev site
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) http://www.example.com/wp-content/uploads/$1 [L,P]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment