There are three modes in CustomErrors Redirect

1.RemoteOnly - Will be redirect other than the Deployed system
2.Off - No redirect will be done
3.On - Redirect will be done in deployed and cleint systems


<customErrors mode="RemoteOnly">
<error statusCode="401" redirect="FileNotFound.aspx"/>
</customErrors>