Skip to content

Instantly share code, notes, and snippets.

@jeffaspenburg
Created August 9, 2019 02:05
Show Gist options
  • Save jeffaspenburg/cc7fe7a67fa45a5c45f45d79dc663e28 to your computer and use it in GitHub Desktop.
Save jeffaspenburg/cc7fe7a67fa45a5c45f45d79dc663e28 to your computer and use it in GitHub Desktop.
WordPress htaccess Production to Local Media
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Pull Image Files From Live Server
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.*\.(png|jpe?g|gif|ico|svg)) https://production-site.com//$1 [NC,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment