Loop I have a script to test a list of url's. What i have noticed is the the script gives an ok 200 for a site that doesn't exist. Reason is the dam ISP has generic redirect for not found dns. Is there a way to prevent this so I can accurately validate if a explicit site is up or not. here is the core piece of code that is returning the responses for url checks.
Do Until objtextFile.AtEndOfStream
Url = Trim(objtextFile.ReadLine)
If Trim(Len(Url)) <> 0 Then
'Set objHTTP = CreateObject("MSXML2.XMLHTTP")
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
appendUrl="http://www." & url
objHTTP.Open "GET", appendUrl, False
objHTTP.send
wscript.echo objhttp.responsetext
If Err.Number = 0 Then
If objHTTP.statusText = "OK" Then
objfile.writeline Now & " Url Status " & objHTTP.statusText & " For " & appendUrl
Else
objfile.WriteLine Now & " Error Connecting " & appendUrl & " ************** Error Loading Site " & "**************"
End If
Else
objfile.WriteLine Now & " Error Connecting " & appendUrl & " ************** Error Loading Site " & "**************"
End If
End If
Err.clear