Forum Moderators: Robert Charlton & goodroi
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?
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.
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...]
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.
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.
<?
$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;
}
?>