Forum Moderators: open
On Error Resume Next
set xmlobj = Server.CreateObject("Microsoft.XMLHTTP")
xmlobj.open "GET", "http://www.someURL.com/Default.asp", False
xmlobj.send ""
strStatus = xmlobj.Status
strRetval = xmlobj.responseText
set xmlobj = nothing
If strStatus = 404 Then
Response.Write "URL Not Found"
ElseIf strStatus <> 200 Then
Response.Write "Error Connecting to URL. Status: " & strStatus
else
Response.Write "Success"
End If
And most of the status codes that should be returned can be found here: [support.microsoft.com ]
Note: A custom 404 page that does not add the 404 status in the Response will return a status of 200 so careful if the site you hit redirects to a custom 404. It appears to the object all HTTP traffic occurred normally.