instead of loading 404 it loads source of my page

Discussion in 'General troubleshooting' started by Joseph Bazalgette, Dec 12, 2011.

  1. Joseph Bazalgette

    Joseph Bazalgette King of the sewers...

    yep, that's correct. It shows the source or the attached screen

    All I am trying to do is redirect a bad url to a custom 404.html page I've created


    this is my web.config

    Code:
    <customErrors mode="RemoteOnly" defaultRedirect="~/error.aspx" redirectMode="ResponseRewrite" >
          <error statusCode="404" redirect="404.html"/>
        </customErrors>
    and I have setup both error pages in IIS to redirect to 404.html

    can someone explain?

    thanks
     

    Attached Files:

  2. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  3. Joseph Bazalgette

    Joseph Bazalgette King of the sewers...

    njeayaah...kinda sorta

    I followed those steps and it did not have any affect at all. Recycled app pool etc etc

    It wasn't until I went to the ASP.NET Error Pages module and added a new status code 404 and did a redirect to the 404.html did it work. From what I read in those step that is not what it was saying to do.

    Anyway, it is now working. thanks anyway
     

    Attached Files:

  4. Elshadriel

    Elshadriel Winhost Staff

    All the modules do in IIS7 Manager is to write the correct entries (i.e. correctly formed XML) to your web.config file. I'm glad you were able to get it working though.
     

Share This Page