@ dfordurai, You could just use the customErrors node in the <system.web> section of the web.config (This code is usually commented out in a new website in VS2008). This would catch all the 404's
and send them to a page called filenotfound.aspx. See example below.
csgulden
Member
14 Points
2 Posts
Re: Checking if a URL Exists and redirect to 404
Sep 16, 2010 11:05 PM|LINK
@ dfordurai, You could just use the customErrors node in the <system.web> section of the web.config (This code is usually commented out in a new website in VS2008). This would catch all the 404's and send them to a page called filenotfound.aspx. See example below.
<customErrors mode="On" defaultRedirect="error.aspx">
<error statusCode="404" redirect="filenotfound.aspx" />
</customErrors>
web.config redirect