I currently have a domain that started as one of those free web pages 6 years ago. The problem is search engines (one in particular) picked up the original domain subdomain and also just the newer domain. www.newdomain.com over the years. I have a sitemap that give the correct addresses but it appears a redirect is required? Most search engines have corrected automatically but (G) has both, held the original and it won't let it go and splits the two addresses.(Both are listed same content) Originally it was www.subdomain.domain.com We have a domain that has been registered for several years and the web host advises because the subdomain is now actually the newdomain I need to redirect. The Redirect 301 / http://www.newdomain.com/ to redirect the entire site causes a endless loop (both original www.subdomain.domain.com and www.newdomain.com are using the same .htaccess file because they are the same directory. I believe I need to redirect only the calls for the original www.subdomain.domain.com with a filter but have had no success in attempts to write it. thanks for any help in advance
You need to be putting the following Code: RewriteEngine On RewriteCond %{HTTP_HOST}//s%{HTTPS} ^subdomain\.(.*)//((s)on|s.*)$ [NC] RewriteRule ^ http%3://%1%{REQUEST_URI} [L,R=301] It will redirect you from the subdomain.newdomain.com to newdomain.com. You could refer to [thread=145]SEO FAQ's[/thread] also
Thanks I will give it a try also. I have been testing and found that the following works also although it took some trial, first I was just getting all the pages redirecting to the home page. I think just not ending the session in the browser was keeping the results from changing. Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} www.origsubdomain.domain.com$ [NC] RewriteRule (.*)$ http://www.origsubdomain.com/$1 [R=301,L]