Last active
November 21, 2017 11:41
-
-
Save mike-source/9ca4d7e54ac7cc5ce6d20fd0e92290e8 to your computer and use it in GitHub Desktop.
rewrite rules for wordpress with remote uploads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# | 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