Skip to content

Instantly share code, notes, and snippets.

@andreud
Last active January 11, 2019 13:49
Show Gist options
  • Save andreud/4bbc86766b836ab9ee8d to your computer and use it in GitHub Desktop.
Save andreud/4bbc86766b836ab9ee8d to your computer and use it in GitHub Desktop.
Wordpress Settings Files
Snippets to configure Wordpress; .httacess, .gitignore, etc.
# Created by https://www.gitignore.io
### WordPress ###
*.log
.htaccess
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
wp-config.php
wp-content/uploads/
wp-content/blogs.dir/
wp-content/upgrade/
wp-content/backup-db/
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
wp-content/cache/*
wp-content/cache/supercache/*
*.log
wp-content/cache/
wp-content/backups/
sitemap.xml
sitemap.xml.gz
# Drop this .htaccess in "/wp-content/uploads/":
# If a file is not present in your local "/uploads" directory,
# it will fetch them from remote or production "/uploads"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) http://your-site.com/wp-content/uploads/$1 [NC,L]
</IfModule>
@macr1408
Copy link

Here is a rewrite for remote uploads using nginx

rewrite ^/wp-content/uploads/(.*)$ https://your-site.com/wp-content/uploads$1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment