IIS7 User Redirection Fails If-Modified-Since Header. Error?

We use the following technique to catch all non-existent URLs and provide our own page:

<handlers>
  <add name="Foo" path="foo.aspx" verb="*" type="Foo.UrlHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
</handlers>

<httpErrors errorMode="Custom">
  <remove statusCode="404"/>
  <remove statusCode="405"/>
  <error statusCode="404" path="/foo.aspx" responseMode="ExecuteURL"/>
  <error statusCode="405" path="/foo.aspx" responseMode="ExecuteURL"/>
</httpErrors>

However, when I check which request headers are passed in UrlHandler, I see everything except one: the If-Modified-Since header does not pass. I see everyone else (Cache-Control, Accept, etc.).

Have you had any experience? This has something to do with this question:

Publishing Forms in 404 + HttpHandler in IIS7: Why Are All POST Data Missing?

Update : I'm not alone - http://www.webmasterworld.com/microsoft_asp_net/3935439.htm

+3
source share
1 answer

. - :

.NET MVC (2, 1-3). :

public static void RegisterRoutes(RouteCollection routes)
{
  routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  routes.MapRoute("All", "{*url}", new { controller = "CatchAll", action = "Index" });
}

CatchAll, , HttpHandler.

+1

Source: https://habr.com/ru/post/1786652/


All Articles