How to change your error pages?

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
The way I do it.

1. Create a subdirectory of public_html to house the pages. I call it 'error' or 'errors'.
2. Create the html files in that directory. I usually name them 404.html etc after the error codes.
3. Go to public_html and open .htaccess to edit
4. Add lines:

ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 500 /error/500.html

Save the file.

5. Try to access a nonexistent file to test.

Note: If you do not see .htaccess in File Manager, close File Manager. At the bottom of cPanel main page, click on reset all interface settings and then click on File Manage. On dialog box that pops up, check "Display hidden (dot) files". That should make .htaccess show up.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Using cPanel File Manager, when you are in public_html , click on "New Folder" icon, upper left of page. Name it what you want.
FTP client should have similar capacity.

You don't have to put them in their own directory, but I like to keep things neat.
 

manu.hotmail58

New Member
Messages
3
Reaction score
0
Points
0
Adding lines in .htaccess will do the work, but the http server response code will be 302 (temp redirect) for non-existent pages. This will create a lower ranking in search engines, as they will index those as duplicate content.

Instead go to "Error Pages" in control panel and select 404 error, then paste the html code in the editor. This will create a 404.shtml in the root. Now you get custom error page but the server response code will be 404 only.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Adding lines in .htaccess will do the work, but the http server response code will be 302 (temp redirect) for non-existent pages. This will create a lower ranking in search engines, as they will index those as duplicate content.

Totally wrong. It generates a 404 response. Perhaps you should do some research before you try to pass out bad information.
 

Zora2012

New Member
Messages
36
Reaction score
0
Points
0
<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>
 

rajdeep01

Banned
Messages
66
Reaction score
0
Points
0
To create a custom error page for your account, please login to cPanel and click Error Pages, under Advanced. Select the domain or subdomain you want and click the page you want to edit. Insert your own custom page code (in HTML or SHTML). The changes will be applied after you click Save.
 

jayanta1

Banned
Messages
41
Reaction score
0
Points
0
[h=1]Using .htaccessfile you can easily change the default error pages that are being served byyour web server. To use .htaccess to modify your web site error pagesyour server needs to be configured with AllowOverride FileInfo. Most webhosting servers are configured in such a way so having a custom error pageinstead of the default ones is possible.[FONT=&quot][/FONT][/h]
 
Top