Author |
Topic |
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 16 July 2008 : 03:05:05
|
quote: Originally posted by SiSL
Response.Redirect command is 301 redirect so...
if request.servervariables("server_name") = "domain.com" then response.redirect("http://www.domain.com/" & request.serverVariables("script_name"))
Having 2 domains with same content gets google angry.
In ASP a response.redirect generates a 302 not a 301< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 16 July 2008 : 03:11:07
|
quote: Originally posted by SiSL
It does gets Google angry still HuwR, lived that --it still gets it as different hosts (x.domain.com, y.domain.com are all treated as different domains), especially notified in Google Tools to select one domain for main. One of friend got a warning and Google deleted his entire indexing to have "duplicate" content.
Canonicalization is the process of picking the best url when there are several choices, and it usually refers to home pages -- www.example.com vs. example.com vs. www.example.com/index.html. Since all these urls are different, a web server could return completely different content for all the urls above. When Google “canonicalizes” a url, it tries to pick the best one and elimintes the others.
That is from Googles own guidlines
to help it choose the correct link you can add a 301 redirect, but it is not necesary and google does NOT penalise you for it.
I will say one thing however, and I have been having this argument with my hosting clients ever since I started. You really should not be pointing domain.com at your web site anyway, that is what the www part is for. if you have to point the domain root somewhere, point it at your mail servers ip instead. < |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 16 July 2008 : 03:14:05
|
so your quickest solution to these issues is to remove domain.com from your host headers and the problem will never occur < |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 14 August 2008 : 08:53:47
|
Just to add to the options already posted, here's what I have at the top of every page:
strRServer=request.servervariables("server_name")
if strRServer<>"www.domain.tld" and strRServer<>"localhost" then
strRQuery=request.querystring
if len(strRQuery)>0 then strRQuery="?"&strRQuery
response.redirect "http://www.domain.tld"&replace(request.servervariables("script_name"),"default.asp","")&strRQuery
response.end
end if < |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
Edited by - Shaggy on 14 August 2008 08:54:16 |
|
|
bobby131313
Senior Member
USA
1163 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 August 2008 : 11:27:34
|
quote: the software really should point the redirects to the directory root, not default.asp.
what software ? if you mean Snitz then it shouldn't be redirecting you anywhere< |
|
|
bobby131313
Senior Member
USA
1163 Posts |
Posted - 14 August 2008 : 11:57:01
|
Redirects and internal links in the Snitz software is what I'm talking about.
There are 207 instances of....
<a href=""default.asp"">
Which in my opinion (and I changed) should be....
<a href=""" & StrForumUrl & """>
There are also 39 instances of...
Response.Redirect("default.asp")
and 7 instances of....
strReferer = "default.asp"
There were more that I changed, but a few months later my problems are solved.< |
Switch the order of your title tags |
|
|
bobby131313
Senior Member
USA
1163 Posts |
Posted - 14 August 2008 : 12:00:48
|
It's really not just for Google though. It's really basic stuff, IMO (and many other experts) you should always link to the folder root to be consistent and facilitate future changes.< |
Switch the order of your title tags |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 August 2008 : 12:30:16
|
not sure how you have 207 instances of <a href=""default.asp""> since there are only 78 in the base code and not once is there a link to just StrForumUrl all the forum links allways point to the forums default.asp so it is consistent.
< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 August 2008 : 12:33:46
|
technically www.domain.com and www.domain.com/default.asp are not the same, so the forum is correct to link directly to its start file of default.asp since you may want www.domain.com to not point at default.asp but point at index.htm or even index.asp< |
|
|
bobby131313
Senior Member
USA
1163 Posts |
Posted - 14 August 2008 : 12:40:28
|
I'm not going to argue with you.
If you want to go read some, you'll find that internal linking directly to the default file name is generally considered poor coding by most webmasters. Especially since 99% of the time when people link to you externally they do not use it (and you can't control it), they link to the directory only. This inconsistency results in EXACTLY what I've fixed by changing the code. Double indexing and serious SEO dilution.
The amount of links is irrelevant. Where the links point is definitely relevant.
I've fixed mine and it worked beautifully, that's all I care about.< |
Switch the order of your title tags |
Edited by - bobby131313 on 14 August 2008 12:41:14 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 August 2008 : 12:48:04
|
Just remember that not everyone has the forums default.asp file as the home page of their website so pointing ALL the forum links at its default.asp is not bad coding at all, it ensures that ALL the forum links point at the forum, and the forum is totally consistant in this respect.
if you need to change it because your forum default.asp is the same as your homepage then that is entirely your choice to make those changes.< |
|
|
bobby131313
Senior Member
USA
1163 Posts |
Posted - 14 August 2008 : 12:53:05
|
quote: Just remember that not everyone has the forums default.asp file as the home page of their website
I never said that. But I would bet there are a very extreme few that it's not the home page of the forum directory.< |
Switch the order of your title tags |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 August 2008 : 13:02:04
|
it won't necesarily fix your issue any, since Icould link to the default.asp page of your forum from here and that would have the same negative effect. you need to have proper redirection scripts to fix it correctly. just changing the links in the forum won't fix it, and don't forget you have quite a few links to default.asp?CAT_ID=XX which will also bugger up your 'fix'< |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 August 2008 : 13:05:55
|
your best bet would be to leave the forum links as they were and change the default file for the forum directory under IIS to index.asp, then write an index.asp file which does a 301 redirect to default.asp then all links to the forum whether they were to / or default.asp would end up at the same url default.asp< |
|
|
Topic |
|