Created
June 21, 2018 17:50
-
-
Save styledev/214a6565d2ed250856431d33aeca4704 to your computer and use it in GitHub Desktop.
Apache mod_rewrite.c code for WordPress to load images from a production server if not found locally. Replace https://www.example.com with your production URL.
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) https://www.example.com/$1 [QSA,L,C] | |
</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