Go4Expert (http://www.go4expert.com/)
-   Search Engine Optimization (SEO) (http://www.go4expert.com/forums/seo-forum/)
-   -   301 redirect of subdomain.domain (http://www.go4expert.com/forums/301-redirect-of-subdomaindomain-t4763/)

rdubayah 19Jun2007 22:30

301 redirect of subdomain.domain
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

shabbir 20Jun2007 08:16

Re: 301 redirect of subdomain.domain
You need to be putting the following

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 SEO FAQ's also

rdubayah 20Jun2007 10:56

Re: 301 redirect of subdomain.domain
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]

All times are GMT +5.5. The time now is 04:02.