I added below code in web.config

```
<system.webserver>        
<httperrors errormode="Custom" existingresponse="Replace">
<remove statuscode="404"/>
<remove statuscode="403"/>
<error statuscode="403" responsemode="Redirect" path="Error/ErrorMessage.html"/>
<error statuscode="404" responsemode="Redirect" path="Error/ErrorMessage.html"/>
</httperrors>

<defaultdocument enabled="false"/>

</system.webserver>

```

Now when I enter url say "<http://localhost:10335/test>" It is redirecting properly to ErrorMessage.html page

but when I enter trailing slash after test say "test/" It is redirecting to url 
"<http://localhost:10335/test/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/Error/ErrorMessage.html>" saying "The page isn't redirecting properly"

Please help me out. Thanks