Custom 404 page

Status
Not open for further replies.

simplemi

New Member
Messages
5
Reaction score
0
Points
1
Iv been working on a new site design, previously using the Site Builder, and now switched over to my own design completely from scratch though I cant seem to figure out how Id setup a custom 404 page.

Iv looked around online and followed the 2 known methods of going into the CPanel, and "error pages", 404, then pasting my 404 pages HTML code (since there was no upload button), and it didnt do anything, so I did it the second way with the .htdocs edit, adding the 404 line, linking to the 404.html page, and it brings up 500 error page instead, but I also noticed in the first method, it uses .shtml instead of .html, and I assume that may be where some of the problem is... Is it possible to have a "fancy" error page with shtml? IE instead of just plain "page not found" text, using your sites fonts and backgrounds/images, etc? And am I possibly uploading it wrong, or doing the process incorrectly?

Thanks.
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
I cant seem to figure out how Id setup a custom 404 page.

The way I do it

1. Create a subdirectory in folder [ public_html ] to house the pages - I named it [ errors ] - to keep them out of the way
2. Create a custom error page(s) in that directory - I usually name them like [ error404.html ] - named for the error code
3. Go to folder [ public_html ] and open (or create) file [ .htaccess ] to edit (there is a dot in front of that name)
4. Add lines (one for each error page you make):

ErrorDocument 403 /errors/error403.html
ErrorDocument 404 /errors/error404.html
ErrorDocument 500 /errors/error500.html
...

Save the file

5. Try to access a nonexistent file to test

while you can use cPanel to setup your error pages on a x10hosting's free-hosting account - if the server is setup for it - I would not count on it
 

simplemi

New Member
Messages
5
Reaction score
0
Points
1
The way I do it

1. Create a subdirectory in folder [ public_html ] to house the pages - I named it [ errors ] - to keep them out of the way
2. Create a custom error page(s) in that directory - I usually name them like [ error404.html ] - named for the error code
3. Go to folder [ public_html ] and open (or create) file [ .htaccess ] to edit (there is a dot in front of that name)
4. Add lines (one for each error page you make):

ErrorDocument 403 /errors/error403.html
ErrorDocument 404 /errors/error404.html
ErrorDocument 500 /errors/error500.html
...

Save the file

5. Try to access a nonexistent file to test

while you can use cPanel to setup your error pages on a x10hosting's free-hosting account - if the server is setup for it - I would not count on it

Wow thanks a lot - I may have just missed a step or done one of those 5 incorrectly, but this worked.
 
Status
Not open for further replies.
Top