-
-
Save MrCoker/f6a21f14cb6b5acec7cf51e00177f07b to your computer and use it in GitHub Desktop.
redirect localhost images from wordpress to production server
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
# my local and production sites use /blog/ as a directory for WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^/blog/wp-content/uploads/[^\/]*/.*$ | |
RewriteRule ^(.*)$ https://www.example.com/blog/$1 [QSA,L] | |
</IfModule> | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /blog/ | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /blog/index.php [L] | |
</IfModule> | |
# END WordPress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment