I am stuck and need someone who knows sharepoint indepth!
EDIT
This is not, not for other errors like 404, 403 ect, this error is somthing else! it only shows when you have a blocked file type in central admin and you go to that blocked extension by url like https://site.mysite.com/portal/default.asp, the asp extension is a blocked file type! it will then show you the error.htm page only! if it were default.aspx it would work as normal becasue aspx is not in the blocked file type list
END EDIT
somthing is overwriting the logic but i dont know what!
Say you have blocked a filetype like asp in sharepoint central admin.
Now you go onto the url and remove from the extention .aspx so that it is .asp
It shows a html page with the title error and says:
The following file(s) have been blocked by the administrator: /portal/default.asp
It is taking that htm page from 12hive located at /_layouts/1033/error.htm ,
I would like to redirect to a custom page but I cant and need to know where that error.htm is being called so I can overwrite it so that it goes to a custom error.aspx page instead!
I have used the following to redirect but it doesnt work:
HttpContext.Current.Server.ClearError();
HttpContext.Current.Response.Clear();
strCustomAcssDndURL = getAppSettingsValue(m_SiteCollCustError + "-" + strSiteURL);
HttpContext.Current.Response.Redirect(strCustomAcssDndURL, false);
but it breaks on:
HttpContext.Current.Response.Redirect();
It throws an error:
Cannot redirect after HTTP headers have been sent.
I am a bit confused as to what to do and if its even possible! For any other error that i get the code above works perfectly!
Any help would be greatly appriciated :)