Jump to content
xisto Community
Shawn

Custom 404 Error Pages A Tutorial On How To Make Custom 404 Error Pages

Recommended Posts

I've seen a tutorial on here and no offense but it was horrific, this is the real way you do a 404 Error Page.

Make a file called: htaccess.txt

Open it up and put this:

ErrorDocument 404 /myerrorpage.html

You will need to change myerrorpage.html to whatever your page is called. Also when you upload this file to your server you need to rename it to: .htaccess

Yes, the dot is before the words. You need to do this on the server because on Windows you cannot do that!

Share this post


Link to post
Share on other sites

I approved this tutorial so that other members who do not have cPanel in their web hosting and who find us on google will know how to make a 404 page.Now, Shawn, I believe that you are referring to fsastraps' 404 tutorial. His code was merely for "myerrorpage.html" so to speak. I know he did not make a .htaccess file as you did because Xisto already has that. You can also make 404 error pages, as well as other error pages, without doing what you did, so there is no need to flame.By the way, Windows XP can make .htaccess. I know because I've done it several times. :rolleyes:

Share this post


Link to post
Share on other sites

Yeah, I've done that on mine, too. However, I sometimes have dificulties naming it that...I get some error message saying that it doesn't have a file name or something...just save it that way using Notepad, and I believe it will do it (I haven't done it in a while, so I don't quite remember how I did it).

Share this post


Link to post
Share on other sites

If you do want to save it as .htaccess on XP then use Notepad to type the file, then click File, Save As. Then select all files from the drop down and type .htaccess as the file name. I've never had any problems doing it this way.

Share this post


Link to post
Share on other sites

hi guys,good topic, now i can make my own 404 error page now. Its good that trap 17 offeres custome 404, as many other free hosts i tried don'y AND their 404 error page is an add page that confuses my viewers. thanks for da service Xisto.tthanks,jman/jerry :rolleyes:

Share this post


Link to post
Share on other sites

Does it matter where in .htaccess it goes cos mine is full of WordPress stuff and I've put it after AuthName http://forums.xisto.com/no_longer_exists/ /home/username/public_html/_vti_pvt/service.pwdAuthGroupFile /home/username/public_html/_vti_pvt/service.grpbut it doesn't appear to be working.Also, should it be/public_html/wp-content/themes/custom/404.phpor/home/username/public_html/wp-content/themes/custom/404.php?

Share this post


Link to post
Share on other sites

I really don't know much about it Tyssen, but my guess would be, or what I would try is to put your 404.php file in a directory called "errors" under the public_html directory and then put the htaccess file also just inside the public_html directory and have it refer to /errors/404.phpthat way it should work as the error page for your entire page... does that help?

Share this post


Link to post
Share on other sites

Your Wordpress installation comes with a 404 page with this in it:

<?php get_header(); ?>Content<?php get_footer(); ?>

Those includes are going to look for headers and footers within the WP content structure, so you must be able to get it to work for the paths that I've specified.

Share this post


Link to post
Share on other sites

Does it matter where in .htaccess it goes cos mine is full of WordPress stuff and I've put it after

AuthName http://forums.xisto.com/no_longer_exists/

AuthUserFile /home/username/public_html/_vti_pvt/service.pwd

AuthGroupFile /home/username/public_html/_vti_pvt/service.grp

but it doesn't appear to be working.

Also, should it be

/public_html/wp-content/themes/custom/404.php

or

/home/username/public_html/wp-content/themes/custom/404.php?

153996[/snapback]

Nope. I always append new htaccess lines if I need to, and they seem to work everytime for me.

Share this post


Link to post
Share on other sites

Hallo,hi your tutorial is like the automated thing on cpanel. i did that insted of yours they the same. BUT i want a custom imaged and other stuff like a real page as a 404 error page, not just a simple OVERLY SIMPLE text page. I want to crearte my custom layout error with graphics and all. like .htm, anf make it fancy.i want to do that? i have created teh page but how do i point vosters to that when they have 404 error??thanks,hellppartyyeao,jerryjman

Share this post


Link to post
Share on other sites

hi man,yes yes, your are right but man, i do that and thats't the same as this tutorial, all it does is create a txt file with what ever you want to say. i WANT to design the page in dreamweaver + fireworks+photoshop CS and graphc it. and then use that as 404 error. not a txt doc.i just need so that everytime teh address is wrong, it automaticly goes to mine coustome 404 error page.help,thaks,party on board,jerryjamn barcardi by night man by day

Share this post


Link to post
Share on other sites

To use a custom .html (or any other type of file) as an error 404 you must use the code stated at the start of this thread:

ErrorDocument 404 /myerrorpage.html

Where myerrorpage.html is the name of the page you want to display as an error 404.

You do not need to put /public_html/ or anything like that, just the name of the file, or if it is in a folder called errors, then put /errors/404.html

Share this post


Link to post
Share on other sites

this will do .php error pages aswell right? and what about when a page is called from a sub directory that results in an error, will the script try to call /subdir/404.php instead of /404.php?and whats the php code to get a users ip, and the page they came from, or were going to?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.