Welcome Guest, Not a member yet? Register   Sign In
Bah! Google index subdomain rather than the real domain!
#1

[eluser]CI Lee[/eluser]
Hello all...


I had been using pr1.domain.com to preview a site for the client. Now I use domain.com yet the google index still points to pr1.domain.com, when someone clicks that link it is valid because the subdomain (or any for that matter) points to domain.com.

Any suggestions on how to fix that? I have the webmaster tools and can do the url removal if I want however I dont want to lose those inbound links.

-Lee
#2

[eluser]garymardell[/eluser]
why not just setup pr1 again and redirect users back to domain.com

for google purposes there is .htaccess methods you can use for google bot etc.
#3

[eluser]CI Lee[/eluser]
Well you can visit pr1.domain.com or xyz123.domain.com and it will still show you the proper site....

The problem is that google thinks that the proper url is pr1.domain.com
#4

[eluser]CI Lee[/eluser]
So I have created a directory of pr1.domain.com and placed
Code:
RewriteEngine On
rewritecond %{http_host} ^pr1.domain.com
rewriteRule ^(.*) http://domain.com/$1 [R=301,L]

Within it as an .htaccess file.

My question is will google update the url in its directory based on that file?
#5

[eluser]Michael Wales[/eluser]
Use a permanent redirect (what is that, a 301, 302, whatever). Google will pick up on it as it spiders the site and correct the URLs.
#6

[eluser]BravoAlpha[/eluser]
301 = Moved Permanently

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Edit:
Quote:301 Moved Permanently
...
The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs.
#7

[eluser]alpar[/eluser]
i think a 302 would be a better solution, that way you will win some time and any ratings will be transfered, also you should add a robot.txt for your build environments to deny spider access.




Theme © iAndrew 2016 - Forum software by © MyBB