It was sent in the server administration forum but I think it's more interesting here. I don't have access to .htaccess file so I have to think PHP. I checked the pages of my site with and without www, I've found out that both versions have the same PR. It's only different with the home page as without www it has PR 3 and with WWW it has PR 2. I put this in my home page: <?php if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.PutYourSiteHere.com/'); } ?> Simply it redirects the home page with “301 Moved Permanently†to the www url. I'm thinking to put this code a php file and include it in the beginning of all my pages: <?php if (substr($_SERVER['HTTP_HOST'],0,3) != 'www') { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); } ?> This should redirect all the non www to the www version of the same page, so I could combine the PageRank and stop the search engines from thinking that I have duplicate content. What do you think?
Actually if the site is hosted on Linux, you can just create a .htaccess file and upload it to your root directory. The file is usually not there unless you put it there, if it is not found, the default apache settings would be used.
You are right my but my host now doesn't allow .htaccess files for security reasons so I'm stuck with that until I move to another host. That's why I thought if using php.
It's very obvious that sites with www and sites without www are seen differently by Google. I see hundreds of threads telling the difference of both sites. One example is this. Why the page rank is different when enter the site with www.?
yes, that is really very usual... in my opinion you should always use the same link for your site, and ever bother if your site has different PR for www and no www
Yes, I usually use the same URLs in order to get the highest PR I desire, I'd rather put www before my domain name.