Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

I learned how to make a customized Error 404 for my site!

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
brainshrub Donating Member (1000+ posts) Send PM | Profile | Ignore Mon Jan-17-05 05:32 PM
Original message
I learned how to make a customized Error 404 for my site!
It works! It works! Woo Hoo! I almost feel like I know something about web design! Yeay me! It will even redirect a person to the homepage after 7 seconds. :D

Here's how I did it:

If You're Using Apache

You probably have a .htaccess file in your Web root directory already, controlling various Apache functions. If you don't have such a file, you need to create one. You can do this whether you are in charge of the server or just one of a number of people who use it.

To serve a custom 404 page, the .htaccess file should contain a line like this:

ErrorDocument 404 /errordocs/404.html

where "/errordocs/404.html" is the name of the file you want to serve. This doesn't have to be a flat HTML file: It can be PHP, ASP, SHTML, or whatever you like. Also note that the file can contain a series of ErrorDocument lines, using the same syntax to serve custom pages for various other errors: 401, 500, whatever you like, just by replacing "404" with the relevant number.

http://webmonkey.wired.com/webmonkey/02/40/index4a_page3.html?tw=backend

In case you're incredibly bord and you want to see what my Error404 page looks like... here it is: www.brainshrub.com/error404


Printer Friendly | Permalink |  | Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC