chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
23 May 07 2:26 pm
Hi Crowzy,
Yes you are right. That would only fix the index part. I don't know much about php coding myself although this coding should work for you. You could use what I gave you, skip a line, and then put this.
Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to [http://www.domain.com]
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ [http://www.domain.com/$1] [r=301,nc]
Please REPLACE [domain.com] and [http://www.newdomain.com] with your actual domain name.
Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.
This is a 301 redirect so it should not hurt your site... I honestly have no idea why it would.