Created
July 8, 2016 09:24
-
-
Save mikaelz/77026af5fe931278340373efc4ee7662 to your computer and use it in GitHub Desktop.
Different RewriteBase on localhost for WordPress Rewrites
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^localhost$ | |
RewriteRule . - [E=REWRITEBASE:/example.com/] | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . %{ENV:REWRITEBASE}/index.php [L] | |
</IfModule> | |
# END WordPress | |
RedirectMatch 301 /wp-content/uploads/(.*)$ http://www.example.com/wp-content/uploads/$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment