|
|
|
|
![]() ![]() |
Sep 18 2006, 11:00 AM
Post
#1
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,045 Joined: 16-August 05 Member No.: 7,896 |
I would like to create my own 404 error pages, with a custumized message like "sorry, not ready yet, but I'm working hard".
What is the procedure for creating customized 404 pages ? Do I simply have to put a "404" subfolder in the www folder, with a index.html page inside ? Or is it more complicated ? |
|
|
|
Sep 18 2006, 12:22 PM
Post
#2
|
|
|
Advanced Member Group: Members Posts: 190 Joined: 18-August 06 From: Fun.NiranVv.Com Member No.: 15,325 |
I'm not aware of using custom Error pages thru CPanel!
But Im using custom error pages for my site www.niranvv.com thru DirectAdmin at my present server! the error pages are: 404.shtml, 403.shtml, 404.shtml, 500.shtml Some sample error pages are here: www.niranvv.com/images/ >> will show you Forbidden error (403.shtml) www.niranvv.com/invalidurl >> will show you Page Not Found error (404.shtml) These are using the same theme of my website www.niranvv.com Edit: If you can edit .htaccess file, then include the following lines: CODE ErrorDocument 401 /someNew401Errorpage
ErrorDocument 403 /someNew403Errorpage ErrorDocument 404 /someNew404Errorpage ErrorDocument 500 /someNew500Errorpage This post has been edited by Niran: Sep 18 2006, 12:26 PM |
|
|
|
Sep 18 2006, 12:26 PM
Post
#3
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,045 Joined: 16-August 05 Member No.: 7,896 |
And where are these pages ? Simply near your index.html, on top of your main folder ?
|
|
|
|
Sep 18 2006, 12:28 PM
Post
#4
|
|
|
Absolute Newbie Group: Admin Posts: 888 Joined: 20-February 05 From: Indianapolis, Indiana, USA (Midwest) Member No.: 2,714 |
Well, the only thing you HAVE to do is create a file named "404.shtml" and place it in any directory that my be requested.
The easier way is to create a .htaccess file in the root of your website and add the following line: CODE ErrorDocument 404 /404.html You can then create what ever file you want. And you can create other error message documents depending on what you need: CODE ErrorDocument 403 /403.html ErrorDocument 404 /404.html ErrorDocument 500 /500.html You can have different .htaccess files in different directories to handle different page requests differently. The .htaccess file can also include text instead of a file like so: CODE ErrorDocument 404 "Man, I have no idea where I put that file! I'm not even sure that I had that file now that I think about it." There are certain environmental variables that you can use in your error documents. Check your cPanel "Custom Eror Pages." for more information. Hope this helps. vujsa |
|
|
|
Sep 18 2006, 12:46 PM
Post
#5
|
|
|
The Modernator Group: Members Posts: 486 Joined: 6-August 06 From: The Interweb! Member No.: 15,021 |
Its very easy to do with cpanel..I know cos Ive just done it and solved your problem
First of all make the HTML file for the custom error page..you could do one different for each error like 404 500 etc Save them as whatever file name you want..you just need the code from them... Login to Cpanel...look under site management tools...locate Custom eror pages...then you will see a menu with each of them on.. Open up for instance Error 404 and then in the blank box you can paste your code from the HTMLs files in there...but only the BODY...also ive found that images have to be in a long URL form not /images in where they point to...so http://yoursite.com/images/error404.gif At the top of the textbox theres some buttons that can turn on ip adress and stuff...Im not using those..but I guess you could wrap them in HTML and display them nicely... GO here to check my error 404 ERROR !!!! |
|
|
|
Sep 18 2006, 01:36 PM
Post
#6
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,045 Joined: 16-August 05 Member No.: 7,896 |
Nice, folks, thanks a lot !
Thanks for the fast reply and smart edit, Niran. Now I know it's possible. Thanks for the explanation, vujsa. now I understand what the .hteccess files are for. And thanks for the cpanel testing, Mark, this is definitively the way I will do it. And, you know, I love your custom page, it's exactly the kind of things I would like to be able to do. Thanks again. Yordan |
|
|
|
Sep 19 2006, 05:25 AM
Post
#7
|
|
|
Advanced Member Group: Members Posts: 190 Joined: 18-August 06 From: Fun.NiranVv.Com Member No.: 15,325 |
Nice, folks, thanks a lot ! Thanks for the fast reply and smart edit, Niran. Now I know it's possible. Thanks for the explanation, vujsa. now I understand what the .hteccess files are for. And thanks for the cpanel testing, Mark, this is definitively the way I will do it. And, you know, I love your custom page, it's exactly the kind of things I would like to be able to do. Thanks again. Yordan You are always welcome Mr Yordan! Please have a look at my new modified Error page ( 404 File Not found error page) Changed it today itself! Its one funny one friend! Check it: www.niranvv.com/InvalidUrl |
|
|
|
Sep 19 2006, 02:05 PM
Post
#8
|
|
|
Premium Member Group: Members Posts: 302 Joined: 23-February 06 From: Northeastern Connecticut USA Member No.: 11,487 |
This is a great topic! I was wondering how to do that too, but just never asked. I went to the custom error pages in cpanel and didn't understand it. I will now reread this carefully and try it. As my site is extremly under construction, it will come in very handy. I'm tired of seeing the old error pages. I want something fresh on my site. Probably noone visits it besides the bots, but thats besides the point.
|
|
|
|
Sep 19 2006, 02:46 PM
Post
#9
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 2,045 Joined: 16-August 05 Member No.: 7,896 |
QUOTE Please have a look at my new modified Error page I love this new page. I love this guy desperately looking for his page, it's really a "page not found", and he is trying hard to find where this page could be. Nice work ! |
|
|
|
Sep 20 2006, 06:13 AM
Post
#10
|
|
|
the Q Group: [HOSTED] Posts: 1,054 Joined: 13-July 05 From: Lithuania, Vilnius Member No.: 7,059 |
That is really a fun error page you have there Niran, but in addition, I remember I participated a lot on this forums about custom error pages and even more with htaccess, here is some links in the forum you can find interesting:
http://www.astahost.com/index.php?s=&s...ost&p=75629 http://www.astahost.com/index.php?s=&s...ost&p=63529 I hope that helps |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 13th October 2008 - 09:31 PM |