See Our Webmaster Tools for Windows and Mac

                                  

how to redirect all pages from old to a new domain via .htaccess?

Started by Black Ninja, May 10, 2012, 03:19:08 AM

Black Ninja

Hi all,

Actually, I want to redirect own old domain to new domain via .htaccess file.
I wrote this code in .htaccess file.
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^OLDDOMAIN\.com$ [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.com [R=301,L]

But old domain is not redirected on new domain. I am using linux server.
Is there any error in this code? Please suggest.   Any help is greatly appreciated!





recommended related video to how to redirect all pages from old  to a new domain via .htaccess
Note: Check our video related to keywords in "how to redirect all pages from old to a new domain via .htaccess" on YouTube.