Not getting custom 404 error page when url contains more than 3 "/" in mvc .net application

Below url works fine and redirects to the custom error page for page not found.


But when the Url is longer like the below one


then it shows the default error page instead of showing the custom error page with message "HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

In the web.config below is added . It works fine for shorter url with max 3 "/" but it doesn't works when it is more than 3.

    <customErrors mode="On" defaultRedirect="~/Error/Index">
        <error statusCode="404" redirect="~/Error/NotFound"/>

Is there any setting required to be done to show the custom error page for longer urls instead of the default iis error page ?