Forum Moderators: open

Message Too Old, No Replies

www or not

         

stevelibby

2:58 pm on Nov 22, 2005 (gmt 0)

10+ Year Member



Up until August my site has ranked extremely well and getting tons of trafis from G, since then, my home page has not been indexed and has fallen of the top of searches, what has puxzzled me most is that my home page has not benn updated and yet the remainder of the site has?
It has been suggested that i have a www and non www issue, how do i resolve this on a windows server and im using asp if that helps.

mattglet

6:17 pm on Nov 22, 2005 (gmt 0)

stevelibby

5:18 pm on Dec 2, 2005 (gmt 0)

10+ Year Member



Thank you for that info, however i am on a shared server.
I have put this code into my home page:

<%
referrer = request.servervariables("Server_name")
If referrer= "Domain.co.uk" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.Domain.co.uk/"
Else if referrer= "Domain.co.uk/index.asp" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.Domain.co.uk/"
Else
END IF
End IF
%>

Will this solve my problem as does work and refers to www. and give a permantent moved, is this correct?

mattglet

6:08 pm on Dec 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that should work fine.

stevelibby

7:13 pm on Dec 2, 2005 (gmt 0)

10+ Year Member



will it affect my ranking?

mattglet

8:12 pm on Dec 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it does at all, it should be for the better.

stevelibby

11:05 pm on Dec 2, 2005 (gmt 0)

10+ Year Member



why should i have had this problem when i havent had it before yet always been on a windows server?
Does the problem originally lie with google and not my host, or could it have been the result of a bad link pointing to domain.co.uk?

TheNige

1:02 am on Dec 3, 2005 (gmt 0)

10+ Year Member



Depending on your DNS host, they may be able to set up a domain forward for you. So that all requests to domain.co.uk get forwarded to www.domain.co.uk before it even touches the web server.

When I was using Zone Edit for my DNS I could make this change myself.

stevelibby

9:07 am on Dec 3, 2005 (gmt 0)

10+ Year Member



I an unable to do anything to the server as its a shared one.

Jalinder

11:10 am on Dec 3, 2005 (gmt 0)

10+ Year Member



stevelibby,
The asp code will not help in your case (non-www to www). You can use ISAPI Rewrite if your host allows.

mattglet

2:07 pm on Dec 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The asp code will not help in your case (non-www to www). You can use ISAPI Rewrite if your host allows.

Can you offer reasons as to why it won't work? Please offer some value to your post.

If he's on a shared host, the chances of him being able to use ISAPI Rewrite are that much smaller.

Jalinder

3:31 pm on Dec 3, 2005 (gmt 0)

10+ Year Member



If referrer= "Domain.co.uk" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.Domain.co.uk/"

>> This condition will be true for all urls along with home page that do not have www, resulting in all urls getting redirected to home page.

Else if referrer= "Domain.co.uk/index.asp" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.Domain.co.uk/"

>> This condition will never be true. request.servervariables("Server_name") does not give full url.

Jalinder

3:45 pm on Dec 3, 2005 (gmt 0)

10+ Year Member



Below code should work for home page as well as other urls (but I have not tested the code):

If Server_name= "Domain.co.uk" then
WWWServer_name = "http://www." & Server_name
If url = "/index.asp" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", WWWServer_name
elseIf url <> "" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", WWWServer_name & url
else
Response.Status="301 Moved Permanently"
Response.AddHeader "Location",WWWServer_name
end if
End If