2

I have a Sitecore solution, where we handle 404 requests.

We do that by setting "ErrorPage" and the "ItemNotFoundUrl" in the web.config:

<setting name="ErrorPage" value="/sitecore/service/error.aspx" />

And

<setting name="ItemNotFoundUrl" value="/Global/ErrorPages/404" />

Now, this works when we edit the name of the page. So if we have www.domain.com/mypage.aspx , and go to www.domain.com/mysdfsa.aspx which doesn't exist, it will show our error-page.

However, if we go to something like:

www.domain.com/mypage.zip / www.domain.com/mypage.gosfgfgs

It gives the IIS error:

Error Summary
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

What have I tried?

We need to make it for for ZIP files at least.

  • Made sure that .ZIP is added to both IIS and Sitecore MIME types
  • Hooked in before the ExecuteRequest pipeline and tried to redirect (this is never called because the IIS gives the errorpage before we get to execute the request)

Any ideas? :-) Thanks

Lars Holdgaard
  • 9,496
  • 26
  • 102
  • 182

1 Answers1

2

I think in the <preprocessRequest> pipeline there's a processor for extensions that Sitecore handles. You should try to update that:

<processor type="Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, Sitecore.Kernel">
  <param desc="Allowed extensions (comma separated)">aspx, ashx, asmx</param>
  <param desc="Blocked extensions (comma separated)">*</param>
  <param desc="Blocked extensions that stream files (comma separated)">*</param>
  <param desc="Blocked extensions that do not stream files (comma separated)"></param>
</processor>
Mark Ursino
  • 31,209
  • 11
  • 51
  • 83
  • 2
    It would be more correct to make sure your IIS handles 404 messages to the same page Sitecore is setup to. – Jan Hebnes Aug 24 '12 at 13:29