Creating a custom 404 page?

fethrdwlf82

New Member
Messages
2
Reaction score
0
Points
0
I have a website that currently doesn't have every page created that is affiliated with every link. That means "Link 1" may work, but "Link 2" might not. Therefore, I would like to create a custom 404 page. I have tried making a ".htaccess" file, and putting it on the root of my server, but it just doesn't work. What content should I put into the .htaccess? And, where should I put it?:confused:
 

loganjohngorence37

New Member
Messages
9
Reaction score
0
Points
0
Go to cPanel and Click Error Pages under Advanced and Edit the one you will want to show, like 404...
EDIT: You may want to make it so then it shows all of the details and tells the user to try again later or email you at a certain email
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
.htaccess goes into public_html

To see dot files, you have to have them enabled in File Manager or your FTP program. If you don't enable them, they are there, you just won't see them.

What I do.
1. Create a folder error in public_html
2. Create your pretty 404 page, name it 404.html and put it in error
3. In the .htaccess file, add the line:

ErrorDocument 404 /error/404.html

4. Repeat for the other errors you might encounter (403 Forbidden, 500 Internal Server Error)

5. If you want to use PHP, you can (file name 404.php, etc). If you know what you are doing, you can then customize the error message.
 

manu.hotmail58

New Member
Messages
3
Reaction score
0
Points
0
Works Great! You may also add absolute path like:
ErrorDocument 404 http://yourdomain.com/page.html


.htaccess goes into public_html

To see dot files, you have to have them enabled in File Manager or your FTP program. If you don't enable them, they are there, you just won't see them.

What I do.
1. Create a folder error in public_html
2. Create your pretty 404 page, name it 404.html and put it in error
3. In the .htaccess file, add the line:

ErrorDocument 404 /error/404.html

4. Repeat for the other errors you might encounter (403 Forbidden, 500 Internal Server Error)

5. If you want to use PHP, you can (file name 404.php, etc). If you know what you are doing, you can then customize the error message.
 

m.stratford86

New Member
Messages
19
Reaction score
0
Points
0
You can add it anywhere, as long as it isn't in the middle of another entry, so bet bet to add it to the end!

If you find it useful, please give me rep!
 

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.
 
Top