Webmaster Forums - Website and SEO Help

Web Development and Design => Database, Server, Coding and Website Administration => Topic started by: Black Ninja on May 10, 2012, 03:19:08 AM

Title: how to redirect all pages from old to a new domain via .htaccess?
Post by: Black Ninja on May 10, 2012, 03:19:08 AM
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!