PDA

View Full Version : how to redirect all pages from old to a new domain via .htaccess?



denniemark
05-10-2012, 03:51 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!

jhonybravo222
05-11-2012, 06:37 AM
You have to take the advice of your developer there might be some code error or there is also a chance of that for Linux server another redirect code is used rather than 301.

denniemark
05-16-2012, 06:17 AM
You have to take the advice of your developer there might be some code error or there is also a chance of that for Linux server another redirect code is used rather than 301.

IS .htaccess file works in Linux server?