When you add a custom IHttpHandler to your ASP .NET Framework 4.7.2 project in a root folder like /Handlers/MyHandler.ashx and you access the url /Handlers/MyHandler.ashx, this handler will be executed,
But if you want this handler to be executed on another path, you will have to register the custom IHttpHandler.
In my case on IIS 10 with application pool in integrated mode (Managed Pipeline Mode = Integrated):
<system.webServer>
...
<handlers>
...
<add name="DownloadFile" verb="*" path="Helpers/DownloadFile.ashx" type="My.Custom.NameSpace.MyHandler, My.Assembly " resourceType="Unspecified" />
</handlers>
</system.webServer>
But if you are also using MVC routing, you will have to ignore this route in the MVC routing:
public static void RegisterRoutes(RouteCollection routes)
{
…
routes.IgnoreRoute("Handlers/MyHandler.ashx");
Solution