Hi All:
First, Merry Christmas to all!. I have this problem. I have old site domain
www.oldsite.com. It have been indexed heavily by Google. I changed domain to www.newsite.com/index.php
I changed domain name as it will loose power after 2004... How I could write a redirect for .htaccess that redirects all traffic to www.newsite.com/index.php
Both sites refer to the same files and same server. I don't want to loose all that traffic. I already have changed politica204.com index file to an HTML that redirects to new site, BUT already indexed links still work and move users to the 'old' site
Any recommendation??
TIA
Edfel
:shock: :(
In .htaccess put:
RewriteCond %{HTTP_HOST} ^newdomain\.com
RewriteRule (.*)
http://www.newdomain.com/$1 [R=301,QSA,L]
This will redirect all to the equivalent on the new domain, providing you keep the same directory structure.
The R=301 flag will ensure that the moved permanently header is returned to the caller, and the QSA (Query String Append) flag will rewrite your URI and append the original QUERY_STRING once rewritten.
You can also use:
redirect permanent /
http://www.example.com/
This will only work it the file structure is exact on the new server as well.
But you said your old domain will "loose power" after 2004. I don't know exactly what you mean by "loose power" but I asusme it means you will no longer have the old domain to use. Since 2004 will be over in a few days it may be too late to effect this properly.
If that domain becomes inaccessible or hosted by someone else none of the rewrite or redirect statements will work unless the old domain continues to be accessible and has these rules in an .htaccess or httpd.conf file for at least long enough to give googlebot time to reindex the new site and follow links (provided you dont have
nofollow in the meta tags). Ususally Google will stop indexing the old domain after a redirect permanent is recieved by googlebot. Exeption to this is dependant on the amount of external referrers to the old domain.
Enjoy!
Zoom