Skip to content

Instantly share code, notes, and snippets.

@mike-source
Last active November 21, 2017 11:41
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 mike-source/9ca4d7e54ac7cc5ce6d20fd0e92290e8 to your computer and use it in GitHub Desktop.
Save mike-source/9ca4d7e54ac7cc5ce6d20fd0e92290e8 to your computer and use it in GitHub Desktop.
rewrite rules for wordpress with remote uploads
# ----------------------------------------------------------------------
# | Override uploads directory paths for local dev |
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^site\.dev$
RewriteRule ^path/to/uploads/(.*)$ http://site.url/path/to/uploads/$1 [NC,L]
</IfModule>
# ----------------------------------------------------------------------
# | Wordpress .htaccess rules |
# ----------------------------------------------------------------------
# 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