1

I have set up a page to handle errors that occur in a website I work on using web.config. I have used the customErrors section in web.config to do this, as described here

Here is the relevant section

  <customErrors mode="On" defaultRedirect="page.aspx?IDDataTreeMenu=357">
     <error statusCode="403" redirect="page.aspx?IDDataTreeMenu=357"/>
     <error statusCode="404" redirect="page.aspx?IDDataTreeMenu=357" />
  </customErrors>

This seems to work for all errors except 404. I just get the standard IIS 404 error when accessing a URL that doesn't exist.

What am I missing here?

This site is hosted on a shared server, so changing settings in IIS is not an option

2 Answers 2

1

Check with the ISP and see if they have a place where you can insert a reference to your own custom 404 page.

At Network Solutions they give you a control panel and a page where you can set this up.

Sign up to request clarification or add additional context in comments.

2 Comments

Surprisingly they don't have a control panel where I can change this sort of thing.
@Sean just to know, why is this closed? I'm facing the same error not being able to redirect in 404 http error to a custom error page. open ticket - stackoverflow.com/questions/72715261/…
0
    <httpErrors>
        <clear />
        <error statusCode="404" subStatusCode="-1" path="/404.asp" responseMode="ExecuteURL" />
    </httpErrors>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.