Valhalla Legends Archive

Programming => Web Development => Topic started by: DVX on January 28, 2004, 12:33 PM

Title: creating custom 404 error pages
Post by: DVX on January 28, 2004, 12:33 PM
recently i've found need of having to create custom 404 pages..  i don't like the default ones..  anyone know how i can do this?  i am using plesk on linux btw if that means anything..
Title: Re:creating custom 404 error pages
Post by: effect on January 28, 2004, 04:23 PM
I believe the standard 404 pages reside somewhere on your web server , simply making your own and then replacing it should do the trick.

Title: Re:creating custom 404 error pages
Post by: Banana fanna fo fanna on January 28, 2004, 05:28 PM
If you're using apache, look at the .htaccess file documentation.
Title: Re:creating custom 404 error pages
Post by: iago on January 28, 2004, 06:43 PM
It totally depends on your web server.  Look at the documentation.

Title: Re:creating custom 404 error pages
Post by: Grok on January 28, 2004, 08:48 PM
Let me get this straight --- you can't find your 404 page?  :p
Title: Re:creating custom 404 error pages
Post by: iago on January 28, 2004, 09:25 PM
It's usually stored at www.yoursite.com/iagoisthebest.txt :)
Title: Re:creating custom 404 error pages
Post by: UserLoser. on January 29, 2004, 01:47 PM
Quote from: iago on January 28, 2004, 09:25 PM
It's usually stored at www.yoursite.com/iagoisthebest.txt :)

Looks like a free credit card give away to me
Title: Re:creating custom 404 error pages
Post by: hismajesty on January 30, 2004, 04:09 AM
Quote from: UserLoser. on January 29, 2004, 01:47 PM
Quote from: iago on January 28, 2004, 09:25 PM
It's usually stored at www.yoursite.com/iagoisthebest.txt :)

Looks like a free credit card give away to me

Looks like "Free Credit Card Gateway!" to me. :)
Title: Re:creating custom 404 error pages
Post by: iago on January 30, 2004, 10:22 PM
Quote from: hismajesty on January 30, 2004, 04:09 AM
Quote from: UserLoser. on January 29, 2004, 01:47 PM
Quote from: iago on January 28, 2004, 09:25 PM
It's usually stored at www.yoursite.com/iagoisthebest.txt :)

Looks like a free credit card give away to me

Looks like "Free Credit Card Gateway!" to me. :)

And guess what, that's the site's 404 page.  You see?
Title: Re:creating custom 404 error pages
Post by: quasi-modo on January 30, 2004, 11:31 PM
wow, all that html being read by my browser has a .txt extention. Interesting
Title: Re:creating custom 404 error pages
Post by: iago on January 31, 2004, 12:54 AM
The extension doesn't matter.  Anything can send the response, "text/html" or "text/plain", the extension only matters if that's how the content-type is decided.
Title: Re:creating custom 404 error pages
Post by: phily05 on January 31, 2004, 11:01 AM
To actually answer your question, make a file called .htaccess in your root directory. Inside that file, type in, or copy and paste this:

ErrorDocument 404 /error404.html

Once again, in your root directory, create a webpage named error404.html. It will read from there. I have it working up on my site.
Title: Re:creating custom 404 error pages
Post by: quasi-modo on January 31, 2004, 05:51 PM
Quote from: phily05 on January 31, 2004, 11:01 AM
To actually answer your question, make a file called .htaccess in your root directory. Inside that file, type in, or copy and paste this:

ErrorDocument 404 /error404.html

Once again, in your root directory, create a webpage named error404.html. It will read from there. I have it working up on my site.
Thats only for apache (as far as I know). For iis you have to set it in the dir settings/
Title: Re:creating custom 404 error pages
Post by: Thing on January 31, 2004, 05:52 PM
He's using Plesk so he doesn't know what .htaccess is.
Title: Re:creating custom 404 error pages
Post by: iago on February 01, 2004, 05:01 PM
Like I said, it's always different, look it up in your server's documentation.  If you're using Apache, modify .htaccess.  If you aren't, don't.
Title: Re:creating custom 404 error pages
Post by: Thing on February 01, 2004, 10:11 PM
iago, he doesn't know wtf you are talking about.  Plesk is a CP installed by administrators so lusers can configure certain aspects of their site.  If he had set up the server himself or if he was an enlightened luser, he would have said he was using Apache on Linux or maybe even Zeus on Linux.
Title: Re:creating custom 404 error pages
Post by: iago on February 02, 2004, 12:32 PM
Quote from: Thing on February 01, 2004, 10:11 PM
iago, he doesn't know wtf you are talking about.  Plesk is a CP installed by administrators so lusers can configure certain aspects of their site.  If he had set up the server himself or if he was an enlightened luser, he would have said he was using Apache on Linux or maybe even Zeus on Linux.

The fact that he hasn't at the very least followed that up by telling us is even worse.  Anybody who really wants help won't post-and-forget :)
Title: Re:creating custom 404 error pages
Post by: quasi-modo on February 04, 2004, 10:01 PM
these are the kinds of things that would be in a major host's faq. Even if you do not run the server yourself, you should definatly know it. Its not a well guarded secret, you can access it like any other server variable.