Friday, February 04, 2005

404 Script

Found a problem with the 404 script in dealing with redirection. Not sure how long this problem has been dogging the script, but it pretty much broke the functionality. Basically, when the script parses the incoming URL it was starting in the wrong position of the URL string. I saw where I had made the mistake and corrected the script. It appears to be working fine now, but I'll need to keep an eye on it to make sure no further problems are encountered.

The sections of code dealing with determining where to begin when parsing the incoming URL had to be changed from:
If Left(txtURI, 1) = "~" Then

intBegin = 1
Else
intBegin = InStr(8, txtURI, "/")
End If
to:
If Left(txtURI, 1) = "~" Then

intBegin = 2
ElseIf Left(txtURI, 4) = "http" Then
intBegin = InStr(8, txtURI, "/")
Else
intBegin = InStr(txtURI, "/")
End If