Welcome to WebmasterWorld Guest from 54.146.194.42

Message Too Old, No Replies

Why does Google think my root page is non www?

Is there an easy way to set up a 301 redirect for the inexperienced?

     
11:57 am on Jul 6, 2005 (gmt 0)

New User

10+ Year Member

joined:June 29, 2005
posts:30
votes: 0


6 months ago my site sank into Goggles supplemental results. Now my site is getting spidered again and it appears in the index. However, it has been indexed as non www. Why does Google think my root page is non www? I hve not changed anything on my site

I still do not get any traffic as the non www of my site only has a PR2, where as the www version has a PR6.

My question is: I am not a programmer, I do not understand about mod-rewrites, or Htaccess, and I have no idea how to set up a 301 redirect. Is there an easy way to accomplish this?

2:29 pm on July 12, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member jimbeetle is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Oct 26, 2002
posts:3292
votes: 6


Hi John,

It isn't always necessary for you to change anything on a site for changes to take place. In this case, somebody probably linked to your index page without the www, Google followed the link and indexed it.

There's a good current thread on redirecting non-www to www with .htaccess [webmasterworld.com] that should explain anything you have to know. There are always a lot of nuances with different server configurations, etc., so be sure to read the entire thread. If you have any problems the folks over there should be able to help you out.

2:54 pm on July 12, 2005 (gmt 0)

New User

10+ Year Member

joined:June 29, 2005
posts:30
votes: 0


thanks jimbeetle

my site had been on Google for a couple of years before it sank into the supplemental results. Its still a PR5 and has over 3,000 incoming links.

I donít understand how or why a few webmasters linking to my site using the non www version would cause this problem.

If I search for my site using "site:http://mysite.com", I find my index page with title and description

If I search using "site:http://www.mysite.com", I find my site but itís just the URL without title or description.

I have just started using Google sitemap to see if this will correct the problem. However I am not sure what is the best way to list my sites URLís and index page. Should I use absolute linking? For example:

index.html

or

[mysite.com...]

or

[mysite.com...]

2:59 am on July 13, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 4, 2002
posts:1687
votes: 0


I donít understand how or why a few webmasters linking to my site using the non www version would cause this problem.

Google thinks there are two separate sites with identical content, (www subdomain and the non-www domain). If the problem has been left to fester long enough, you could now have duplicates of every page on the the site listed in G. This is not good.

Added: Absolute linking could be helpful, and is probably the better choice. It at least tells the bots that the links are to the preferred canonical version. For your index/default use ht*p://www.mysite.com or with a trailing slash. Don't add /index.html or G could see that as yet another page.

8:07 am on July 13, 2005 (gmt 0)

Full Member

10+ Year Member

joined:Jan 3, 2003
posts:325
votes: 0


>>> My question is: I am not a programmer, I do not understand about mod-rewrites, or Htaccess, and I have no idea how to set up a 301 redirect. Is there an easy way to accomplish this?

If I were you, I would contact my hosting company and ask them to do it. In case they want to charge for the service, I would pay if it was reasonable. If they can't do it, I would consider changing the hosting company.

2:13 pm on July 27, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Another tip: when you link to an index page, end the URL with a trailing / and don't include the actual index file filename in the link at all.
4:52 pm on July 27, 2005 (gmt 0)

New User

10+ Year Member

joined:Oct 1, 2004
posts:27
votes: 0


If your server allows PHP files you could try something like this. Place it at the top of your front page and it should redirect http://example.com to http://www.example.com without the need for updating the .htaccess. Note that you would have to ensure that all links on your site are absolute and link to the www URLs or else you would have to paste this at the top of all pages (could use an include file). Anyhow I'd recommend using the htaccess method, but since you asked...

<?
$domain = $_SERVER[SERVER_NAME];
$domainWithSubdomain = $_SERVER[HTTP_HOST];
$subdomain = str_replace($domain,"",$domainWithSubdomain);

if($subdomain == "")
{
// Forward visitor to the URL with the subdomain
header("Location: [$domain...]
exit;
}
?>