Skip to content

Instantly share code, notes, and snippets.

@mcascardi
Created September 21, 2020 23:19
Show Gist options
  • Select an option

  • Save mcascardi/a5e3f84f111546df18fed7a4960498ee to your computer and use it in GitHub Desktop.

Select an option

Save mcascardi/a5e3f84f111546df18fed7a4960498ee to your computer and use it in GitHub Desktop.
A configuration snippet for spoofing the uploads directory in a WP local development environment.
# Apache example configuration, added inside the <VirtualHost> directive, or root server block if VirtualHost is not being used.
<Directory "${SRVROOT}/htdocs/www.example.local/wp-content/uploads">
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) https://www.example.com/wp-content/uploads/$1 [L,R,NE]
</IfModule>
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment