Forum Moderators: Robert Charlton & goodroi
My websites looks like http://sub1.example.com, http://sub2.example.com etc. Now, when I search for keywords like < keyword picture >, I can see my website on 10-40th page of Google SERPs (before December it always was on 1st page). I can see 2 results:
http://sub1.example.com/keyword.html (right url)
http://www.sub1.example.com/keyword.html (error 404)
How can I fix this problem? How to remove http://www.sub1.example.com/ from Google's index?
[edited by: tedster at 1:18 pm (utc) on Mar. 3, 2007]
[edit reason] use example.com [/edit]
Although, I think most, including myself went for the with www redirect google will then notice the permanent redirect and after sometime will forget the ones with www.
----
Verification error
Part of the process of setting a preferred domain is to verify that you own www.sub1.example.com. We were unable to process the verification.
----
I'm not able to insert verification code into pages that are not exist.
Is there another way?
The other option is to do a mod_rewrite eg;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ [domain.com...] [R=301,L]
[q]The other option is to do a mod_rewrite eg;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ [domain.com...] [R=301,L][/q]
In what file should I add this code?
Is there some step-by-step tutorial? I'm afraid to make some mistake and get trouble with Google.
Then you should be able to click on preferred domain and change the radio button to 'Display URLs as sub1.example.com (for both www.sub1.example.com and sub1.example.com)'.
I would still suggest doing the rewrite version too (i do it on all of my sites), this requires to to be able to edit or use a '.htaccess' file. For more information on that I suggest looking through google.
But the basic principle is that you create a file named .htaccess and insert the following code;
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.sub1\.example\.com$ [NC]
RewriteRule ^(.*)$ [sub1.example.com...] [R=301,L]
and upload it to your root folder.
This will basically tell browsers and google 'www.sub1.example.com' has been permentantly changed to 'sub1.example.com' and all of the old 'www' entries will be removed from googles index.
If you are not the owner of the domain example.com you will not be able to verify that you own the site.
But the basic principle is that you create a file named .htaccess and insert the following codeRewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.sub1\.example\.com$ [NC]
RewriteRule ^(.*)$ http://sub1.example.com/$1 [R=301,L]
Alexy9, you said your website is http://sub1.example.com. Do you own the domain name example.com, or is example.com a hosting site that allows sub domains like sub1.example.com?
[edited by: tedster at 9:03 pm (utc) on Mar. 4, 2007]
[edit reason] de-link the urls [/edit]
Still can't find a way to fix this. :(
[edited by: tedster at 6:48 pm (utc) on Mar. 6, 2007]