Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

When Reaching an Inactive Page



10:14 pm on Jan 19, 2007 (gmt 0)

5+ Year Member

How can I get a generic message when someone reaches a page on my site that no longer exists?

Some get a 404 error. Some do nothing.
Is it a server-related issue?

smells so good

10:28 pm on Jan 19, 2007 (gmt 0)

5+ Year Member

Yes, it is a server issue. You can easily create your own custom 404 (or any other server error) page if you have a text editor and access to the .htaccess file on your server.

You'll need to make sure that the .htaccess file on your server contains this information.

ErrorDocument 404 /404.php

Then, create 404.php

header("HTTP/1.0 404 Not Found");
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
echo "Custom 404 Not Found";

There are a couple of things to be aware of.

  • Check the server headers on this page.
  • In the ErrorDocument statement of your .htaccess file, do not use the full path to your document. My 404.php script is located in the root directory, as indicated by the statement.
  • In the 404.php script, you can echo any custom message that you want.
  • Ensure that no whitespace or text is echoed in the script before the headers are sent.
  • Change the first header, and filename, to create any custom server error message.
  • Check the server headers on this page.


  • mkinstlinger

    8:20 pm on Jan 23, 2007 (gmt 0)

    5+ Year Member

    Thanks for your reply.


    8:23 pm on Jan 23, 2007 (gmt 0)

    10+ Year Member

    For SEO and user experience purposes considering doing a 301 to a page with relevant content. People are visitng that page - don't waste the traffic.

    Featured Threads

    Hot Threads This Week

    Hot Threads This Month