Thanks,
i have found one link http://www.wwwcoder.com/main/parentid/263/site/2295/68/default.aspx
as per the article code
Option Strict On
Imports System.Data
Imports System.Configuration
Public Class _404Handler
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Try
Dim strQuery As String = Request.ServerVariables("QUERY_STRING")
If strQuery <> "" Then
'Now we'll remove the stuff we don't need.
strQuery = strQuery.Replace("404;http://", "")
'Get rid of the domain name since we're dealing with multiple domains.
Dim intSlashPosition As Integer = strQuery.IndexOf("/")
strQuery = strQuery.Remove(0, intSlashPosition)
' now do a lookup in our table to find out if there is a related page.
Dim NewURL As Integer = DoURLLookup(strQuery)
If NewURL <> -1 Then
Response.Redirect("/DesktopDefault.aspx?TabID=" & NewURL.ToString)
Else
'if we don't have any, just send them to the home page of the site.
Response.Redirect("/")
End If
Else
Response.Redirect("/")
End If
Catch ex As Exception
Response.Redirect("/")
End Try
End Sub
'This function performs the lookup in the database to find a related page for the broken link.
Function DoURLLookup(ByVal inURL As String) As Integer
Dim cnn As New SqlConnection(ConfigurationSettings.AppSettings("connectionString").ToString)
Dim myCommand As SqlCommand = New SqlCommand("SELECT NewTabID FROM " & _
"NotFoundLookup WHERE OldURL = '" & Replace(inURL, "'", "''") & "'", cnn)
cnn.Open()
Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
If result.Read Then
Dim TabID As Integer = CType(result("NewTabID"), Integer)
cnn.Close()
Return TabID
Else
cnn.Close()
Return -1
End If
End Function
End Class
if we change on UrlRewriteModule.vb file
' if a match was found to the urlrewrite rules
If intMatch <> -1 Then
If rules(intMatch).SendTo.StartsWith("~") Then
' rewrite the URL for internal processing
RewriterUtils.RewriteUrl(app.Context, sendTo)
Else
' it is not possible to rewrite the domain portion of the URL so redirect to the new URL
Response.Redirect(sendTo, True) // Replace with 404.aspx page
End If
End If
i have not implited this code.
Is that possible to Redicrect on 404 Error page if URL not or found?