top button
Flag Notify
Site Registration

How to Handling Custom Error Page (404&403) in IIS7?

0 votes
345 views
How to Handling Custom Error Page (404&403) in IIS7?
posted Feb 2, 2016 by Jayshree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

Step1: In web.config file Write the following code

<system.web>

<customErrors mode="On">

          <error statusCode="404" redirect="PageNotFound.aspx" />

          <error statusCode="403" redirect="PageNotFound.aspx" />

      </customErrors>

</system.web>

 <system.webServer>

<httpErrors errorMode="Custom" existingResponse="Replace">

          <remove statusCode="404" />

          <remove statusCode="403" />

      <error statusCode="404" path="PageNotFound.aspx" responseMode="Redirect" />

      <error statusCode="403" path="PageNotFound.aspx" responseMode="Redirect" />

      </httpErrors>

</system.webServer>

Step2: Settings need to be updated in IIS7

1) Open IIS

2) Select your application

3) Open Error Pages under the IIS section -> clicks Open Features

enter image description here

4) After clicking Open Features tab we will get below shown window. Now click Edit Feature Settings tab

enter image description here

Then we will get below shown window,

enter image description here

In the above window select radio button Custom Error Pages àok

_Step3:
_Open the file:

C:\Windows\System32\inetsrv\config\applicationHost.config

_And change:

<section name="httpErrors" overrideModeDefault="Deny" />

_To:

<section name="httpErrors" overrideModeDefault="Allow" />
answer Feb 2, 2016 by Manikandan J
Similar Questions
0 votes

HI Guys

I have iis 7 503 server error on my website.How to solve this issue.Please help me.

HTTP Error 503 - Service is unavailable

Thanks

+3 votes

I want get Number of indexed pages of any website so, it will give me exact number of pages in google.
What I have tried:

Uri queryUri = new Uri(string.Format("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:{0}", url));
using (WebClient client = new WebClient())
{
    string getString = client.DownloadString(queryUri);
    dynamic s = JsonConvert.DeserializeObject(getString);
    var IndexedPage = s["responseData"]["cursor"]["estimatedResultCount"].Value;
    lblIndexedPageRecv.Text = IndexedPage;
}

its working but not giving me right answer

my code is giving different values then other online webCheckers like one of this: http://www.pingler.com/seo-tools/tools/google-indexed-pages-checker

...