Last active
April 6, 2016 15:42
-
-
Save anhtuank7c/6271ca239865b9551fa81ad1d0f646ca to your computer and use it in GitHub Desktop.
CakePHP: Redirect old domain to new domain using .htaccess
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^old_domain.com [NC,OR] | |
RewriteCond %{HTTP_HOST} ^www.old_domain.com [NC] | |
RewriteRule ^(.*)$ http://new_domain.net/$1 [L,R=301,NC] | |
RewriteRule ^$ webroot/ [L] | |
RewriteRule (.*) webroot/$1 [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment