FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how to edit my 404 error page?





speeDemon
Well, I saw a website, in which it was showcased that you can change your 404 error page, you know the one that comes saying page not availible...

I wanted to know how to edit this page, using Cpanel... or lets just say, that my website is hosted by frihost, and so, obviously I am using Cpanel.. and all other services provided by frihost... so how do I edit my 404 error page?? Question
cr3ativ3
Ah Yes!

It is quite easy to create custom error pages, such as the infamous 404 not found page. Because these pages are controlled by apache you can use .htaccess files to define custom 404 pages.

All you need to do is create a .htaccess file in your public_html folder named '.htaccess', (do not put anything before the '.'.

Now to define a custom error page for a 404 error, you need to add these directives to your .htaccess file.

Code:
ErrorDocument 404 /404.html


Now to create your custom 404 page, you will need to create the 404.html file, in the public_html folder as well.

So an example of the contents of the 404.html file could be:

Code:

<html>
<head>
<title>404 Not Found (So Sad)</title>
<body>
<h1>404 Not Found</h1>
<p>
It's unfortunate, but we couldnt find the page you were looking for!  We wish you luck in future ventures!
</p>
</body>
</html>


Let me know if any problems arise.

Good Luck.
Arseniy
If you're using cPanel, then you can find a special function dedicated to custom error pages. You can change them using standart html + some special error codes. Quite simple for my mind.
speeDemon
cr3ativ3 wrote:
Ah Yes!

It is quite easy to create custom error pages, such as the infamous 404 not found page. Because these pages are controlled by apache you can use .htaccess files to define custom 404 pages.

All you need to do is create a .htaccess file in your public_html folder named '.htaccess', (do not put anything before the '.'.

Now to define a custom error page for a 404 error, you need to add these directives to your .htaccess file.

Code:
ErrorDocument 404 /404.html


Now to create your custom 404 page, you will need to create the 404.html file, in the public_html folder as well.

So an example of the contents of the 404.html file could be:

Code:

<html>
<head>
<title>404 Not Found (So Sad)</title>
<body>
<h1>404 Not Found</h1>
<p>
It's unfortunate, but we couldnt find the page you were looking for!  We wish you luck in future ventures!
</p>
</body>
</html>


Let me know if any problems arise.

Good Luck.


Hey, thanks for that reply, but I'm trying, and it's not quite working...

I'd like to tell you that my website is saved as an add on domain... actually I had bought a ".com" name for my website, and to redirect it to the host (frihost) then I needed to add a addon domin thing...

I've put the files in my addon domain folder.. which is inside the public_html..

I'll try to put the files directly in the public_html...

soo, i'll eply again,.
cr3ativ3
speeDemon wrote:
cr3ativ3 wrote:
Ah Yes!

It is quite easy to create custom error pages, such as the infamous 404 not found page. Because these pages are controlled by apache you can use .htaccess files to define custom 404 pages.

All you need to do is create a .htaccess file in your public_html folder named '.htaccess', (do not put anything before the '.'.

Now to define a custom error page for a 404 error, you need to add these directives to your .htaccess file.

Code:
ErrorDocument 404 /404.html


Now to create your custom 404 page, you will need to create the 404.html file, in the public_html folder as well.

So an example of the contents of the 404.html file could be:

Code:

<html>
<head>
<title>404 Not Found (So Sad)</title>
<body>
<h1>404 Not Found</h1>
<p>
It's unfortunate, but we couldnt find the page you were looking for!  We wish you luck in future ventures!
</p>
</body>
</html>


Let me know if any problems arise.

Good Luck.


Hey, thanks for that reply, but I'm trying, and it's not quite working...

I'd like to tell you that my website is saved as an add on domain... actually I had bought a ".com" name for my website, and to redirect it to the host (frihost) then I needed to add a addon domin thing...

I've put the files in my addon domain folder.. which is inside the public_html..

I'll try to put the files directly in the public_html...

soo, i'll eply again,.


If you had setup the domain in cPanel/Directadmin find the root folder for that domain, and place the files in their.
speeDemon
Hey guys!

thanks for the replies!
but I got a method of doing it..

In Cpanel, there was a topic named "error files" I just opened it, and it gave me options to edit my 400 401 402 403 404 and 500 error pages!

then it gave me a box, in which I could write scripts..

I just copied the script from my 404.html , and pasted it there... and now its working fine!

Just for your knowledge, It saved the file as 404.shtml
probably you know what that relates to, I don't though!

But I guess, like cr3ativ3 said that use .htaccess and put "ErrorDocument 404 /404.html" they must be having some similar kind of file with the code "ErrorDocument 404 /404.shtml" and they just let you edit that file(404.shtml) from the "Error Document" title in their main control panel!

so whenever there is any error, it redirects to "ABC.shtml"...

edit

Hey guys, check it out! here is a false page (that doesn't exist), press the link, and it will show you the 404 error page, please tell me how it looks!

www.adizonetutorials.com/I-dont-exist.html
cr3ativ3
speeDemon wrote:
Hey guys!

thanks for the replies!
but I got a method of doing it..

In Cpanel, there was a topic named "error files" I just opened it, and it gave me options to edit my 400 401 402 403 404 and 500 error pages!

then it gave me a box, in which I could write scripts..

I just copied the script from my 404.html , and pasted it there... and now its working fine!

Just for your knowledge, It saved the file as 404.shtml
probably you know what that relates to, I don't though!

But I guess, like cr3ativ3 said that use .htaccess and put "ErrorDocument 404 /404.html" they must be having some similar kind of file with the code "ErrorDocument 404 /404.shtml" and they just let you edit that file(404.shtml) from the "Error Document" title in their main control panel!

so whenever there is any error, it redirects to "ABC.shtml"...


Thats Correct.
speeDemon
Has anyone seen my error page till now? please comment!
gueda
speeDemon wrote:
Has anyone seen my error page till now? please comment!


I saw it ^^ and is very cool heuheuhe
I like the color in "error 404" green and red alternate

EDIT: Is not better you put the search bar and home button at the top ?

PS: I like the tutorials about flash!! Omg i will install it again Razz
speeDemon
gueda wrote:
speeDemon wrote:
Has anyone seen my error page till now? please comment!


I saw it ^^ and is very cool heuheuhe
I like the color in "error 404" green and red alternate

EDIT: Is not better you put the search bar and home button at the top ?

PS: I like the tutorials about flash!! Omg i will install it again Razz


Thanks!

Quote:
PS: I like the tutorials about flash!! Omg i will install it again Razz


okk great then see you again at AZT!!
you can e-mail me if you have any poblems!
Alton_gary
If your 404 page redirects to site.com/404/, then you are doing your 404 error commands wrongly on your website.Read this to fix it:
How to Customize Your 404 File Not Found Page
http://www.thesitewizard.com/archive/cus...
It includes the correct way to set up your .htaccess file so that visitors will be able to see the original wrong address in their browser.
speeDemon
Alton_gary wrote:
If your 404 page redirects to site.com/404/, then you are doing your 404 error commands wrongly on your website.Read this to fix it:
How to Customize Your 404 File Not Found Page
http://www.thesitewizard.com/archive/cus...
It includes the correct way to set up your .htaccess file so that visitors will be able to see the original wrong address in their browser.


Well I've already got my error page running, but thanks for the tip any way!
Mike_Host
In cPanel

First you click on "File Manager" be sure to click "Show Hidden Files" (dotfiles).

Go into the public_html folder.

Then highlight the .htaccess file and at the top click "Code Editor"

Then when the edit screen comes up put this on the page:

ErrorDocument 404 http://www.minisitespot.com/


Change the "minisitespot.com/" to the address you want ALL your 404 pages to be forwarded to.

Then if anybody tries to go to any extension that doesn't exist, they will be routed to the page you specified in the code above. You can test it to see it working on my site. Just type my URL with /anything you want and you will go to my homepage.

I hope this helps,



Mike Host
www.MinisiteSpot.com
Related topics
Replace the 404 ERROR PAGE
.htaccess again
Servers
about 404 error page
AWStats Viewer throwing up a 404 error
Using PHP in error pages
error page
.htaccess file and 404 error
Seven Elements of a Successful Web Presence
So, how is my new error page?
Checking for values in database and displaying error page
Joomla 1.6 login form 404 page
Newbie with some questions
404 Not Found error when file viewed without login
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.