Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Problem with www. - in front of subdomain

         

alexey9

12:26 pm on Mar 3, 2007 (gmt 0)

10+ Year Member



My websites was penalized in the mid of December as a lot of other websites. I have lost 99% of Google traffic.

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]

wheelie34

3:04 pm on Mar 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



301 all unwanted www domains to their non www via htaccess, thats what most people here did around that time when it all went boobs up.

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.

futureX

4:14 pm on Mar 3, 2007 (gmt 0)

10+ Year Member



you can do it in google's webmaster tools by selecting your preferred domain.

alexey9

5:02 pm on Mar 3, 2007 (gmt 0)

10+ Year Member



I've tried to do this with Google Webmaster Tools, but I got error message:

----
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?

rocker

5:33 pm on Mar 3, 2007 (gmt 0)

10+ Year Member



I'm not able to insert verification code into pages that are not exist.

Is there another way?

Google also allows you to make a .html page to verify your site.

Example: http://www.example.com/googlecode-ehfojfjijfij.html

futureX

5:34 pm on Mar 3, 2007 (gmt 0)

10+ Year Member



did you try doing the html page verifcation method, and did you add to webmaster tools as www. or without, you will need to do it without.

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]

alexey9

9:49 am on Mar 4, 2007 (gmt 0)

10+ Year Member



[q]Google also allows you to make a .html page to verify your site.[/q]
Yes, but where I should upload this page? I have only "non-www" website. I do not have www. version or folder on my server.

[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.

futureX

10:20 am on Mar 4, 2007 (gmt 0)

10+ Year Member



If you go into webmaster tools, add your site just as 'http://sub1.example.com' when doing validation choose the option for verification file, it will give you the filename to upload. Just make a new text file and rename it to the filename google gives you, upload that file to; [sub1.example.com...]

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.

rocker

11:57 am on Mar 4, 2007 (gmt 0)

10+ Year Member



Alexy9, you said your website is [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?

If you are not the owner of the domain example.com you will not be able to verify that you own the site.

futureX

1:09 pm on Mar 4, 2007 (gmt 0)

10+ Year Member



If you are not the owner of the domain example.com you will not be able to verify that you own the site.
Not true, you can add subdomains to google webmaster tools without access to the main domain, you just wont be able to add teh main domain.

alexey9

8:53 pm on Mar 4, 2007 (gmt 0)

10+ Year Member



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 ^(.*)$ http://sub1.example.com/$1 [R=301,L]


I did this. But how to check it work or not? When I go to http://www.sub1.example.com, I get error. Browser do not redirect to http://sub1.example.com. Is that normal?

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?

Yes, I own the domain example.com.

[edited by: tedster at 9:03 pm (utc) on Mar. 4, 2007]
[edit reason] de-link the urls [/edit]

futureX

9:06 pm on Mar 4, 2007 (gmt 0)

10+ Year Member



whats the error you get?

i may have done something wrong in that rewrite lol

alexey9

10:35 am on Mar 5, 2007 (gmt 0)

10+ Year Member



My browsers are not in English. The error sounds like "Browser can not find server http://www.sub1.example.com"

[edited by: tedster at 6:47 pm (utc) on Mar. 6, 2007]
[edit reason] de-link the url [/edit]

alexey9

11:46 am on Mar 6, 2007 (gmt 0)

10+ Year Member



I did find out that some of my 7 subdomains still indexed as http://sub.example.com only (as it been for 2last 2 years), not both http://www.sub.example.com and http://sub.example.com. Looks like Google bug to me.

Still can't find a way to fix this. :(

[edited by: tedster at 6:48 pm (utc) on Mar. 6, 2007]