Skip to content

Instantly share code, notes, and snippets.

@eversionsystems
Created June 19, 2021 06:52
Show Gist options
  • Save eversionsystems/8ce3d689cb96d22f6147508595b68bd3 to your computer and use it in GitHub Desktop.
Save eversionsystems/8ce3d689cb96d22f6147508595b68bd3 to your computer and use it in GitHub Desktop.
Load WordPress server upload directory files from localhost. Circumvent having to download large wp-upload directories so we can load images locally.
#Allow us to load images from server instead of having to download them all for large sites
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/[^\/]*/.*$
RewriteRule ^wp-content/uploads/(.*)$ https://yourwebsitename.com/wp-content/uploads/$1 [NC,L]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
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