Custom Error Page

jdmrace

New Member
Messages
20
Reaction score
0
Points
0
Can anyone help me make a custom error page with a log?

I am currently using the .htaccess file to handle redirections:
Example1: ErrorDocument 404 http://example.com/error/?code=404
but for some reason it does not work using relative layout such as:
Example2: ErrorDocument 404 /error/?code=404

My .htaccess file is located in the www or public_html directories. When I try to access a 404 page while I use example 1 it automatically redirects to the url.

Is there any way to stop the redirection. I don't want the error to redirect because it will make it harder to trace where the visitor was when the 404 page was encountered. I would like to stay away from referers because I think it is possiable for people to send false or blocked referer.

Is there any alternative way to have custom error pages with the url unaltered?
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
In the cPanel, near the bottom, is a helper that easily lets you create custom error pages; No htaccess or URL mess-ups.
It is very simple to use.
:)
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
You can usually do this by adding the following code to your .htaccess file :-
ErrorDocument 404 /location/to/404.html
 

jdmrace

New Member
Messages
20
Reaction score
0
Points
0
Does anyone know how google programmed their error page?
Example: http://www.google.com/404error.html
It displays the error message on the nonexistent requested page with the original url without any redirection.

When I tried using the ErrorDocument 404 (url) it redirects the browser to the url with the error page. I want to find a alternative way to display a error page rather then a redirection to the (url).
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
What do you mean by it redirecting? I have never seen an error redirect.
If you want to customize it easily, there is a helper called "Error Pages" which you can edit the error page with HTML. Then, you can trace where the 404s occurred by going to "Error Log." It works very well and you don't have any redirects. Just try it out.
:)
 
Top