Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Custom 404 Errorpages : How ?, how can I make my own 404 error pages ?
yordan
post Sep 18 2006, 11:00 AM
Post #1


Way Out Of Control - You need a life :)
Group Icon

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 ?
Go to the top of the page
 
+Quote Post
Niru
post Sep 18 2006, 12:22 PM
Post #2


Advanced Member
Group Icon

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
Go to the top of the page
 
+Quote Post
yordan
post Sep 18 2006, 12:26 PM
Post #3


Way Out Of Control - You need a life :)
Group Icon

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 ?
Go to the top of the page
 
+Quote Post
vujsa
post Sep 18 2006, 12:28 PM
Post #4


Absolute Newbie
Group Icon

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. cool.gif

vujsa
Go to the top of the page
 
+Quote Post
Mark420
post Sep 18 2006, 12:46 PM
Post #5


The Modernator
Group Icon

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 wink.gif

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 !!!!

Go to the top of the page
 
+Quote Post
yordan
post Sep 18 2006, 01:36 PM
Post #6


Way Out Of Control - You need a life :)
Group Icon

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
Go to the top of the page
 
+Quote Post
Niru
post Sep 19 2006, 05:25 AM
Post #7


Advanced Member
Group Icon

Group: Members
Posts: 190
Joined: 18-August 06
From: Fun.NiranVv.Com
Member No.: 15,325



QUOTE(yordan @ Sep 18 2006, 07:06 PM) *

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: wink.gif


www.niranvv.com/InvalidUrl
Go to the top of the page
 
+Quote Post
lonebyrd
post Sep 19 2006, 02:05 PM
Post #8


Premium Member
Group Icon

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.
Go to the top of the page
 
+Quote Post
yordan
post Sep 19 2006, 02:46 PM
Post #9


Way Out Of Control - You need a life :)
Group Icon

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 !
Go to the top of the page
 
+Quote Post
Quatrux
post Sep 20 2006, 06:13 AM
Post #10


the Q
Group Icon

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 wink.gif
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. 406 Error(15)
  2. Newbie Help Please! Log In Error(4)
  3. If You Got Mambo Skills(1)
  4. How Can I Include A File In A Html Page ?(11)
  5. How To Bypass The Disabling Of Right-clicking In Pages.(12)
  6. Gallery Stopped Working(3)


 



- Lo-Fi Version Time is now: 13th October 2008 - 09:31 PM