Forum Moderators: open
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.
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.
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
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.
---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.
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
%>