404 Error Problem ... Pl. help ..

Results 1 to 2 of 2

Thread: 404 Error Problem ... Pl. help ..

  1. #1
    Join Date
    Dec 1969

    Default 404 Error Problem ... Pl. help ..

    I am creating a HTML-to-ASP conversion utility...<BR>I want some help in the following case:<BR>After replacing the .htm with .asp extension with same filename, the user is redirected to the new .asp page... <BR>But what if the old filename with new .asp does not exist ....<BR>I then want to show, as the last resort, shown a customized 404 error page.<BR>Any suggestions/help would be appreciated !!

  2. #2
    Join Date
    Dec 1969

    Default RE: 404 Error Problem ... Pl. help ..

    You could use FileSystem.FileExists("file.asp") to determine if the file exists and then redirect according to the Boolean Result of that check....<BR><BR>Example:<BR><BR>Dim objFileSystem, strMessage,strPageX,strRedirectPath<BR><BR>Set objFileSystem = CreateObject("Scripting.FileSystemObject")<BR><BR> strPageX = "PageX.asp"<BR><BR>If (objFileSystem.FileExists(strPageX)) Then<BR><BR>strRedirectPath = strPageX<BR> <BR>Else<BR><BR>strMessage = URLEncode(strPageX & " Does not exist!")<BR><BR>strRedirectPath = "CustomErrorPage.asp?urlMessage=" & strMessage<BR><BR>End If<BR><BR>Reponse.Redirect("strRedirectPath")<BR>< BR><BR>Noe this is rough but it should point you in the right direction...<BR><BR>Good Luck,<BR><BR>Jesse

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts