|
bigtime -> RE: Response.Redirect and SEO (5/16/2006 8:29:19)
|
kt, Below is an example of the code I used. Notice the commented out sections starting with the "Case". When I got into trouble, was when these were not commented out. Of course, now that code doesn't even appear on my new page, but I kept this copy as an example of what NOT to do. Basically I looked for the beginning of the IP addresses that I knew were obvious bots and just redirected to the page rather than write to the database (big No No).
<%
Request.QueryString("Homepage")
URL=Request.QueryString("Homepage")
' IF request.servervariables("REMOTE_ADDR") > "" THEN
' myTempArray = split(request.servervariables("REMOTE_ADDR"),".")
' SELECT CASE (myTempArray(0) & "." & myTempArray(1))
' CASE "66.196","68.142","216.117","65.54","212.227","216.52","66.34","203.252","65.19","69.89","66.191","146.94","193.77","68.95","69.57","81.196","68.51","206.225","68.14","67.159","210.177"
' Response.redirect(url)
' END SELECT
' END IF
Dim oConn, oRs
Dim mySQL, connectstr
Dim db_name, db_username, db_userpassword
Dim db_server
db_server = "********"
db_name = "******"
db_username = "******"
db_userpassword = "******"
connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open connectstr
mySQL= "INSERT INTO Redirect "
mySQL= mySQL & "(URL,IPADD,DTIME) "
mySQL= mySQL & "VALUES ('" & Request.QueryString("Homepage") & "','"
mySQL= mySQL & Request.servervariables("REMOTE_HOST") & "','"
mySQL= mySQL & dateadd("H",+2,now()) & "')"
Set oRS = oConn.Execute(mySQL)
Set oRs = nothing
Set oConn = nothing
Response.Redirect URL
%>
Since I have changed the code, I have had no issues with the search engines, in fact my rating is the highest it has ever been for my key phrase searches. But that is this week's algorithm. :) As for your other questions, I am no SEO expert by far...unfortunately I can only tell you what I did wrong. Maybe one of the experts on this site can give you more information on these questions.
|
|
|
|