Created
November 23, 2017 04:55
-
-
Save topleague/0a624f54e840d679eb6d1ac9eacc41c0 to your computer and use it in GitHub Desktop.
Code for .htaccess File (Redirecting an Old Domain 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
#Use PHP 5.4 | |
# Use PHP54 as default | |
AddHandler application/x-httpd-php54 .php | |
<IfModule mod_suphp.c> | |
suPHP_ConfigPath /opt/php54/lib | |
</IfModule> | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC] | |
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301,NC] | |
# BEGIN WPSuperCache | |
# END WPSuperCache | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
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