Skip to content

Instantly share code, notes, and snippets.

@AlexWebLab
Last active August 16, 2016 09:31
Show Gist options
  • Save AlexWebLab/a318ca7e83b0300ddfedd64b25505afc to your computer and use it in GitHub Desktop.
Save AlexWebLab/a318ca7e83b0300ddfedd64b25505afc to your computer and use it in GitHub Desktop.
How to permanently redirect all the pages of a WordPress website to a new domain
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !.*NEWDOMAIN\.COM$ [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.COM/$1 [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment