Hi Naresh,
you can achieve this by adding a meta tag in the header section of your HTML output:
<meta http-equiv="refresh" content="10; URL=http://xxx.com/wherever.aspx"></meta>
Addition:
This should be added to the error page and since you want this for 404 errors also, you'll have to create a customized Error page.
Cheers
Manfred