I am using http request to check broken links on a page. few of the links are redirected links, but I am getting a 404 error. any idea?

Use the following site as an example:


<font class="small">Code:</font><hr /><pre>
On Error Resume Next
Dim objLinks
Dim intLinkCount
Dim intCount
Dim strLinkName
Dim strURL
Dim strTitle

Set objSection = Browser("title:=.*Verizon.*").Page("title:=.*veriz on.*").WebElement("html id:=footerLinks", "Location:=0").Object
Set objLinks = objSection.GetElementsByTagName("A") 'get all the object links

intLinkCount = objLinks.Length - 1 'count number of links

For intCount = 0 To intLinkCount 'run through the link count loops
strLinkName = Trim(objLinks(intCount).innerText) 'get innertext
strURL = Trim(objLinks(intCount).href) 'get the href

If strLinkName &lt;&gt; "" And InStr(strURL, "javascript") = 0 Then
Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", strURL, False 'open up the http request
objHTTP.Send 'Send the request.

If Err.Number = 0 OR InStr(Err.Description,"Access is denied") &gt; 0 OR objHTTP.Status &gt; 0 Then 'check to see if there are any error numbers
If InStr(Err.Description,"Access is denied") = 0 Then 'check to see if it is access is denied message
intPageStatus = objHTTP.status 'get the status.

If intPageStatus &lt; 200 OR intPageStatus &gt; 399 Then 'check the error status
Reporter.ReportEvent micFail, "Link Name: " &amp; strLinkName, "Link Name: " &amp; strLinkName &amp; ", URL: " &amp; strURL &amp; ", Error Code: " &amp; intPageStatus &amp; ", Error Description: " &amp; objHTTP.StatusText'Writes to log
Reporter.ReportEvent micPass, "Link: " &amp; strLinkName, "Successfully validated: " &amp; strLinkName &amp; ", URL: " &amp; strURL 'Writes to log
End If
End If
Reporter.ReportEvent micFail, "Link Name: " &amp; strLinkName, "Error Number: " &amp; Err.Number &amp; ", " &amp; Err.Description &amp; ", Link: " &amp; strLinkName &amp; ", URL: " &amp; strURL 'Writes to log
End If

'Release object from memory
Set objHTTP = Nothing
Err.Clear 'clear the error
End If

'Release object from memory
Set objSection = Nothing
</pre><hr />