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