Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: how to create a simple 404 error page  (Read 3510 times)

Offline FnCool

  • xtreemhost Addict
  • ***
  • Posts: 243
    • View Profile
how to create a simple 404 error page
« on: October 11, 2009, 08:44:33 AM »
to create a simple 404 page, you need to do 2 things:

Part 1:
You'll need an .htaccess file which will instruct the server on what to do if a page doesn't exist...
Open a new text document, inside paste this line:
Code: [Select]
ErrorDocument 404 /404.html
Save the file as ".htaccess" (no quotes)
You may have to set your computer to show hidden files,  the alternative is to save it as "1.htaccess", then when you upload it, rename it to ".htaccess".
If you have an existing .htaccess file, then just add that line to it.

Part 2: Create the actual 404.html page
again, you can open a new text document, paste the following code:
Code: [Select]
<html>
<head>
<title>page doesn't exist</title>
</head>
<body>
that page doesn't exist<br>
please go back to what you were doing<br>
<a href="index.php">HERE</a>.
</body>
</html>
save it as 404.html
replace the "index.php" with the page you would like them to return to, (usually index.html or index.php)
you can also replace any of the other text in that page to your liking.

NOTE: this is the simplest, if you would like to make a better one, try googling "create a 404 page"

Offline glenn_admin

  • Administrator
  • xtreemhost Ultrafan
  • *****
  • Posts: 3032
    • View Profile
Re: how to create a simple 404 error page
« Reply #1 on: October 11, 2009, 11:52:45 AM »
Thanks for the tutorial!
Hope some people will make use of it.
No support by PM please, only send me a PM if I asked you to do so.

Offline TERMINATOR T-101

  • xtreemhost Member
  • **
  • Posts: 27
    • View Profile
Re: how to create a simple 404 error page
« Reply #2 on: April 15, 2010, 10:43:17 AM »
many thanks

xtreemhost Forums

Re: how to create a simple 404 error page
« Reply #2 on: April 15, 2010, 10:43:17 AM »