Forum Moderators: phranque

Message Too Old, No Replies

Problem with Custom 404 Page

On IIS Server

         

jthom

9:28 pm on May 24, 2005 (gmt 0)

10+ Year Member



I recently set up a custom 404 page on our MS server which works in some cases, but does not work in others. For example:

www.domain.com/badlink - works
www.domain.com/badlink.html - doesn't work

www.domain.com/badlink - works
www.domain.com/badlink.asp - works

www.domain.com/directory/badlink - works
www.domain.com/directory/badlink.html doesn't work

any thoughts?

physics

6:36 pm on May 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi jtholm. Welcome to WebmasterWorld! I don't know anything about IIS but it sounds like maybe you have some sort of special rules set up for .html files in there (the IIS version of rewrites?). Poke around in the config and see if there is anything suspicious...

jezra

11:16 pm on May 26, 2005 (gmt 0)

10+ Year Member



is it always an html file that fails to display the 404 or does it happen with .asp, .php, .htm etc.?

steve

9:26 am on May 27, 2005 (gmt 0)

10+ Year Member



How are you doing it?

Are you using .net?

ie:

<customErrors mode="On" >
<error statusCode="404" redirect="FileNotFound.aspx" />
<customErrors>

jthom

1:45 pm on May 27, 2005 (gmt 0)

10+ Year Member



Hi all - thanks for helping.

I set this up through the IIS 5 Internet Service Manager control and then > Default Web Site Properties > Custom Errors.

404 Error Mapping Properties are set to go to my custom page: mydomain.com/404.html

The 404 page is displayed correctly when the file name has a .asp, .php, .xhtml or .htm extension or even a made-up extension like .blah.

The custom 404 page does not display for .html or .shtml pages - just the usual ie "Page Not Found"