Skip to content

Instantly share code, notes, and snippets.

@davemac
Forked from solepixel/.htaccess
Last active August 29, 2015 14:24
Show Gist options
  • Save davemac/7484eb8f32f67d425c36 to your computer and use it in GitHub Desktop.
Save davemac/7484eb8f32f67d425c36 to your computer and use it in GitHub Desktop.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Use uploads directory from live site
RewriteBase /wp-content/uploads/
RewriteCond %{HTTP_HOST} !^www\.livedomain\.com
RewriteCond %{HTTP_HOST} !^livedomain\.com
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) http://livedomain.com/$1 [L,NC]
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