Jump to content
xisto Community
yordan

Custom 404 Errorpages : How ? how can I make my own 404 error pages ?

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites

I'm not aware of using custom Error pages thru CPanel!

But Im using custom error pages for my site http://niran.in/ thru DirectAdmin at my present server!

the error pages are: 404.shtml, 403.shtml, 404.shtml, 500.shtml

 

Some sample error pages are here:

 

http://forums.xisto.com/no_longer_exists/ >> will show you Forbidden error (403.shtml)

 

http://forums.xisto.com/no_longer_exists/ >> will show you Page Not Found error (404.shtml)

These are using the same theme of my website http://niran.in/

 

Edit:

If you can edit .htaccess file, then include the following lines:

 

ErrorDocument 401 /someNew401ErrorpageErrorDocument 403 /someNew403ErrorpageErrorDocument 404 /someNew404ErrorpageErrorDocument 500 /someNew500Errorpage
Edited by Niran (see edit history)

Share this post


Link to post
Share on other sites

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:

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:
ErrorDocument 403	 /403.htmlErrorDocument 404	 /404.htmlErrorDocument 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:
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

Share this post


Link to post
Share on other sites

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://forums.xisto.com/no_longer_exists/

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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: :)

 

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 !

Share this post


Link to post
Share on other sites

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://forums.xisto.com/topic/89467-topic/?findpost=

http://forums.xisto.com/topic/87897-topic/?findpost=

I hope that helps :)

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.