Last active
August 16, 2016 09:31
-
-
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
This file contains hidden or 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 | |
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