Intercepting SharePoint error messages in IIS - iis

Is there any way to intercept SharePoint error messages in IIS?
For example, when I type this url: https://mywebsite.com/~.aspx, SharePoint answers with its own error page that says:
Sorry, something went wrong
The file or folder name contains characters that are not permitted. Please use a different name.
I would like to intercep this error message (and all SharePoint error messages) and redirect to my own custom error page.
Please note that:
When SharePoint shows this error in its own error page, the url remains the same (https://mywebsite.com/~.aspx)
When I inspect the page (F12) in the Network tab (using Chrome) the response is 200 OK, so no SharePoint is not reporting the error number back.
I expect to be able to somehow configure IIS in order to intercept any SharePoint errors and then show a custom made page instead of showing the standard and internal SharePoint error pages.

Related

Http 403 error in Microsoft edge

I was getting "HTTP 403 error Microsoft Edge can’t get to this page", while launching an application from IIS in Windows 10. Please suggest a solution for this.
thanks
If all permissions are set and even though your website shows 403 forbidden, most likely the default page is not set for your website. With IIS, you can configure the default document as follows.
Connect to IIS.
Expand the sites and select the desired website.
From right hand side feature view, click on Default Document.
Set your desire default page and save the settings.
While you browse any website, IIS searches for the default page to be displayed. If the first default document is not available, IIS will look for the next default page from the list. When IIS is unable to find any match and directory listing is enabled for that particular website, IIS will show you the list of folders. If directory listing is disabled, IIS will return an HTTP Error 403 - Forbidden message to the browser.
If an empty application gives you a 403 I can think of two immediate reasons.
The permissions are wrong. You might need to give the application pool user (IIS AppPool\NAMEOFAPPPOOL with recommended configuration) read permission to the directory.
You don't have any content. If you try to access a directory in IIS you will get a 403. Add a file and try to access that directly, or a Default.aspx or index.html file to the directory you're trying to access.

Understanding a 404 error in IIS

I have a classic asp web application in which I've created a custom friendly 404 page. Also within that page, I have logic to email me the 404 info so I can check it out as to why it happened.
One of the pieces of info I email to myself is
Request.ServerVariables("HTTP_REFERER")
As I understand it, it should tell me the origin of the 404, ie. the page which is making the request to the file that doesn't exist.
However, I get notifications where the Referer is referencing a page in my site that doesn't exist in the first place. How can this be? Am I pulling the wrong ServerVariable? Is someone trying to do some cross site scripting?

where can i find the default 404 error page for windows sharepoint service 2.0

Where can i find the default htm file, mapped to show the 404 error in Sharepoint service 2.0. Currently whenever the request for a site hits the 404 error, it goes to the default page, but the point to note here is, which is not the one we set in IIS custom error option.
My requirement here is to make few modification in the 404 error page. I tried mapping the request to a custom error page with <customErros> tag in web.config. But unfortunately, its still showing the default 404 error page. When i checked the viewsource of the error page i can see some comments like, res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
Any idea about this? Thanks in advance
I haven't had to do this but this entry looks quite reasonable: http://blogs.msdn.com/b/jingmeili/archive/2007/04/08/how-to-create-your-own-custom-404-error-page-and-handle-redirect-in-sharepoint-2007-moss.aspx
Basically when you install WSS it hi-jacks IIS. You can still do most of the things you would expect but you need to go through the Central Administration pages and the XML files that control many aspects of SharePoint.

problem using a custom 404 page in IIS

I have a web site with a child directory set up as an application. I set up the application to use a custom 404 page. When I navigate to the url and put in a non existent page I get the following error message. Any other asp page in the application works fine. There isn't even any script in the 404 page... just plain html so I'm not sure what is causing this. I've tried creating an application pool specifically for this application but that didn't help. Thanks.
Error message: The specified request cannot be executed from current Application Pool
Try to create a registry key with the name IgnoreAppPoolForCustomErrors (type DWORD, value 1) in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\
See http://blogs.msdn.com/rakkimk/archive/2006/09/01/735684.aspx or http://www.yanghengfei.com/show-131-1.html for more information - seems to be a not so uncommon problem.

Browsing a SharePoint publishing page returns a 404 error message

I've changed the master page on a publish site collection. When I browsed back to the start site to check the new master page the browser just returned a 404 error, telling me that the page could not be found.
But when I open the site collection with the SharePoint Designer every thing seems to be ok and in its place. All pages are as expected in the page library. Within the Designer I could even open the pages for editing.
So does anyone has an idea why the browser cannot find and open the pages?
UPDTAE
To clarify my problem I should say, that also switching back to the default master page doesn't bring back the site. I still get a 404 response. So the problem shouldn't be directly related to my custom master page.
Approve the Master Page ?

Resources