Scripts » 404 PagesThis really isn't so much a script as it is a tutorial. How do you make your very own custom 404 page? It's incredibly simple, actually. Requirements « domain or subdomain name « permission from host (if subdomain) « one html-based page If you own your own domain, you should already have 400, 401, 403, 404, and 500 pages on file, premade for you by your hosting site. This ensures that if a visitor tries to access a page that does not exist or that they aren't authorized to view that they will not be able to see it. If you already have your 404.html page set up, open the coding in a File Manager or transfer it to your computer via FTP and view it in NotePad or TextPad. If you don't already have one, you will need to make one. This means that you have a subdomain (i.e. yoursite.host.com). If your host wants your secure pages to go directly to their own, then you will have to ask permission from your host to create your own custom 404 page. Do that by e-mail, it's more personal. The above code is the generic 404 page. What you want to do is make it your very own. How? You can do pretty much anything you want with it. It's just a normal HTML page, so you can put any codes, images, or scripts in the code that you'd like. Here is an example of a custom 404 page. If you want the viewer to see what page they typed in so that they can correct their mistake, use this script: (Domains) You should be done. Upload/save your 404.html page to your root directory and check to see if it works by typing a bogus web address like http://yoursite.com/pickles.html. If your 404 page came up, you're good to go. If not, try reading over the tutorial again, or continue reading below. You may need an .htaccess page as well. (Subdomains) Once you're done customizing, you're going to need to do one more thing. Open NotePad and type this: Change the http://yoursite.host.com to your site's actual web address (i.e. mine would be http://never.caution-tape.net). Save the NotePad file as .htaccess DO NOT FORGET THE PERIOD. If you already have a .htaccess page on your root directory, add the ErrorDocument 404 line somewhere in the .htaccess file. Upload the 404.html and .htaccess pages to your root directory. Check to see if it works by typing a bogus web address like http://yoursite.host.com/pickles.html. If your 404 page came up then your work is done. If not, try reading over the tutorial one more time. |