Forum Moderators: open

Message Too Old, No Replies

Site split between www and non-www

Google is treating www.mydomain.com and mydomain.com as two sites

         

mymommybiz

3:31 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



Google has somehow come to believe that my site is split. www.mydomain.com is the right one - its got the proper PR, the DMOZ listing under the site in the results, all the backlinks.

mydomain.com is showing a PR1, no backlinks (at least that show up), no DMOZ listing underneath my listing in the results. It essentially is treating it as a different site from the www one. It makes no difference whether the index.html is tacked on the end or not.

I am a high traffic site, and I don't want people typing in the shortened URL and think I have been penalized, or wonder what I have deserved to get a PR1.

This is a long-running site, so it is not a case of a new site being indexed.

Any thoughts or corrections to this issue? I have done searches here, because I know this has been discussed, but I couldn't find a past discussion.

mcavic

3:40 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're running Apache, you can use mod_rewrite to put a permanent redirect from domain.com to www.domain.com. Here's what mine says (in httpd.conf):

RewriteEngine on

RewriteCond %{HTTP_HOST}!www\.domain\.com
RewriteRule (.*) [domain.com$1...] [R=permanent,L]

In other words, if the user got here by any name other than www.domain.com, then redirect them.

metablue

3:41 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



I thought it had always been like that, that
www.mysite.com
mysite.com
www.mysite.com/index.html
mysite.com/index.html
were all considered different sites.

Can anyone confirm or deny this?

mcavic

3:44 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's true, search engines have always treated them that way. Most SE's probably filter out the duplicate pages, so it doesn't really matter to them.

killroy

3:45 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Of course they have to be considered different, because the ARE different.
You HAPPEN to have set them up to point at the same files, but that's just you (well and most of us).

Since I'm quite free to run completely different pages on mydomain.com and www.mydomain.com Google MUSt oncsider them seperately.

So setup that 301 quickly or you might even get penalised to a PR 0 on one of them!

SN

mcavic

3:49 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, Killroy, they have to be considered separately. But if they were penalized, half of the web would be penalized.

killroy

4:17 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well I had such a case were one domain is panlised now... I haven't even considxered it and totally forgotten that domain.. now I've set up all alternative domains as 301 redirects...

SN

metablue

4:24 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



What I find strange is that all my backlinks point to www.mysite.com, and none to mysite.com, and as of this update they both have the same PR4. This didn't use to be the case. No redirections set up. There always seems to be some exception to the rule.

jdMorgan

4:49 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In .htaccess, you may need this first line as well:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=permanent,L]

(Note start anchor added to RewriteCond and slash added to RewriteRule)

Jim

jranes

4:58 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



Anybody know the syntax for this on IIS off the tops of their head? I have the 301 asp code from this site but haven't found the syntax to pick up non www urls.

vincevincevince

4:59 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



argh! i didn't think about duplicate content when setting up my site.

structure is:
john.widgetfinder.com
jane.widgetfinder.com
etc...
which lead to a login page pretty much identical for each one

and
www.widgetfinder.com and widgetfinder.com
which lead to site information, account creation, etc.
_also_ the left/right nav links on the account.widgetfinder.com pages are the same for all, but pass to eg:
account.wigetfinder.com/information.htm, which is identical content to that at jimmy.wigetfinder.com/information.htm, and www.wigetfidner.com/information.htm

I have not been able to get indexed - is this the cause? If so, google's being really stupid, cos it's certainly a valid site layout, not designed to spam, or anything similar.

jranes

5:14 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



I did think of one way I could do this in IIS. I already have a 404 page that sends a 301 header and redirects to the www.domain.com. Currently I have host headers set up for www.domain.com and domain.com in the same web. Instead I need to break out domain.com to its own web and make the root my 404 page. I hope anyone needing this in IIS can follow what I am saying but if not sticky me and I'll break it down for ya.

---edit----
Yes, this does work. I just set up my domain this way and typing in domain.com sends a 301 header and then redirects to www.domain.com. Jeesh, I've been trying to figure that out in IIS for two years.

jdMorgan

5:24 pm on Apr 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jranes,

Try the asp code in this post [webmasterworld.com].

Jim

jranes

5:27 pm on Apr 11, 2003 (gmt 0)

10+ Year Member



Thanks jdMorgan, that works even better! WW rocks.

So this can either be described as above for a server based solution, or using the code linked to by jdMorgan with the 301 code on WW we get this asp solution that could be put in a globaly shared asp include or at the top of each page as asp in the site.

<%
dim domainname, i, sNewRef
domainname = request.servervariables("HTTP_HOST")
i = instr(1, lcase(domainname), "www")

if i=0 then

Response.Status = "301 Moved Permanently"
sNewRef = "http://www.domain.com" & Request.ServerVariables("SCRIPT_NAME") & "?"
sNewRef = sNewRef & Request.ServerVariables("QUERY_STRING")
Response.addheader "Location", sNewRef
Response.End()

end if
%>