MacLean Fitzgerald
asked on
htaccess file
I am moving domains. On the old domain I created an htaccess file with the following contents only:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old.com$
RewriteRule (.*)$ http://www.new.com/$1 [R=301,L]
Is this correct? Should I have any other code or text int he file?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old.com$
RewriteRule (.*)$ http://www.new.com/$1 [R=301,L]
Is this correct? Should I have any other code or text int he file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what you want actually .
As your htacces says that it has to redirect to new one
please elaborate your reuirement
As your htacces says that it has to redirect to new one
please elaborate your reuirement
ASKER
I believe I figured out the issue. I had the DNS host pointing towards the correct spot, but I didn't realize that www, via CNAME, was still pointing towards the old host. I have rectified the mistake.
ASKER
old.com/why/because
they end up on
new.com/why/because
Not to mention, if they go to www.old.com or old.com, they get forwarded to www.new.com