laserlight wrote:You can use PHP to create a page that can be used as a custom error 404 page, but setting that page as the custom error 404 page depends on the web server configuration, e.g., .htaccess.
My settings for my personal Apache web server
file:
apache/conf/httpd.conf
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /no_such_page.html
ErrorDocument 403 /you_are_not_allowed.html
#ErrorDocument 402 http://localhost/subscription_info.html
*note:
You should be able to put the same config into .htaccess as laserlight told
- but only if your HOSTING allow you to use a custom ERROR PAGE directive.
Especially many free hosts does not support this ...
But if you pay .. would be possible, most hostings.
If your host does not allow this, you will mostly get:
Internal Server Error
if you try put a custom Error page in your .htaccess.
As i have 100% control, I can do anything = My personal web server apache is in my own computer
with no go-between-hosts with advertising stuff
and such hook-ups to try to
get you upgrade to PAyPal paying money hosting,
i can do anything.
I set the rules, my own rules,
for my web server and
no other can set any Terms and conditions: this and that
My server ...... it works!
Most common HTML Errors are those 2:
ErrorDocument 404 /no_such_page.html
ErrorDocument 403 /you_are_not_allowed.html
not found(error404) and not authorized (error403, no permission to)
But you can add a page for all other HTTP errors
Information about this:
Wikipedia - List of HTTP status codes
Regars 🙂 to you
halojoy