Skip to content

, ,

How to create a Custom 404 Error page in DNN

by on May 10, 2011

In the web.config file find <customErrors mode=”off”  /> and replace with the below to only respond to 404 errors (page not found, page missing, page renamed). Now just create a page called “404 Error” on your dnn instance at the root level (or reflect the correct path in the url).

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

Or, if you want to change the default error page or other error pages as well, try:

<customErrors mode="RemoteOnly" defaultRedirect="DefaultError.aspx">
       <error statusCode="404" redirect="404error.aspx"/>

       <error statusCode="302" redirect="302error.aspx"/>       

  1. Hey

    I tried this but it doesn’t work 😦

    Any ideas?

    • Where did you run into issues? What version of DNN?

      • Hi Emerson

        I am using version and when I browse to a non existent page I just get the normal 404 page rather than my own.

        This is in my web.config:

  2. seem to be missing some of the above.

    I beleive in IIS 7/.net 4 (?)/DNN 6 there are additional settings you need to adjust for the web config – possibly under application. This article was written for DNN 4/5 if I remember correctly.

    Search the web.config for anything to do with errors, as the application error settings may be overriding these older format error settings.

    • Hi Emerson

      Turns out this was a PICNIC error (Problem in chair, not in computer :))

      My 404 was working all along but I was typing non existant addresses into the address bar and not realising that the 404 specified in the web.config only deals with pages – eg aspx etc. Any other invalid urls fall back to IIS handling so I just need to configure IIS to handle 404s as well!

      Thanks for your help


  3. Glad to hear you got it working and that it is still valid for DNN 6.x!

  4. Tobias permalink

    Unfortunately, it does not seem to work. It just gets a 302

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: