Need help?

Our experts have had an average response time of 13.52 minutes in October 2021 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Apache Errordocument 404 not working – Here’s the quick fix

by | May 7, 2019

By default, Apache comes with a set of standard error documents. They show up when the requested website page do not exist.

Often these response pages can be intimidating to site users. That’s where custom error-document helps. But, it needs additional configuration and often result in Apache error-document 404 not working message.

And, Bobcares’ Engineers fix Apache error-document settings as part of our Server Administration Services.

Today, we’ll see how we setup and fix Apache error-document 404 error.

 

Why custom Apache error-document ?

Firstly, let’s check on why we need a custom error document in Apache web server.

Website owners focus on user friendliness in every web page. As a result, they may wish to provide custom error responses in their website.

Luckily, Apache helps to set custom error document using the ErrorDocument directive. Users can set this for the entire server globally, for a single website, or in directory context. For site specific settings, it can be set in .htaccess file.

And, it allows to include custom error page that fits to the site layout.

The syntax of the ErrorDocument directive is:

ErrorDocument <3-digit-code> <action>

For example, in real servers it looks like

ErrorDocument 404 /404.php 

Here, 404.php is the custom designed web page.

 

What causes 404 error in custom error-document?

Now, its time to check the various causes that result in custom error document failure.After setting the custom error page, if the page is not accessible, it end up in a ‘Page not found‘ aka 404 error.

From our experience in managing Apache servers, the major reasons for Apache Errordocument 404 error are:

 

1. Wrong path

Unfortunately, a major share of problems with custom error-document happens due to wrong path setting of the error page. For instance, when the custom error page 404.php reside inside a sub folder, calling it by the path /404.php results in error. In short, relative path may create problems.  Therefore, path should be specified as the absolute path to your exact file. On a cPanel server, this would be something like /home/user/public_html/error_pages/404.php

 

2. Incorrect website settings

Similarly, even after designing custom error pages, some customers forget to enable it on the domain. This typically happens in servers with control panel. For example, in Plesk servers, improper setting of Custom error documents in Hosting Settings can cause trouble.

 

3. Browser error page settings

Again, turning on “friendly” error page in browsers can also be a reason for Apache Errordocument 404 not working.

For instance, “Friendly HTTP Error Message” is a feature that is enabled by default in Internet Explorer browser. If the server response to some common errors like 404 is less than 512 Bytes, then IE’s “friendly” error page is displayed instead of custom error page.

 

How we fix custom error-document for website

When customers report problems with custom error pages, our Dedicated Engineers follow a step by step procedure to figure out the problem. Let’s have a look at the exact steps.

    1. Check the direct link of the custom 404 page. When that is accessible, we rule out the possible coding problems with the custom web page. This means the problem lies with the configuration.
    2. We, then check the ErrorDocument settings in .htaccess file. Or ,if it is set in httpd.conf, we verify and correct the VirtualHost settings of the domain.
    3. Next, we set the full path to the error page in .htaccess file. Again, in servers with control panels like Plesk, we set the option correctly as shown below.

Again, even after correctly setting ErrorDocument,  if the problem exists, our Dedicated Engineers advise customers to turn off Internet Explorer’s friendly error message. For this, in Internet Explorer, Under Internet Options > Advanced > Browsing, uncheck the “Show friendly HTTP error messages” option.

[Having trouble with Apache ErrorDocument? We can fix it for you.]

 

Conclusion

In short, Apache Errordocument 404 not working error mainly happens due to wrong path setting, incorrect Apache configuration and many more. Today, we saw the typical reasons for the error and how our Support Engineers fix and make custom error page working.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Reviews

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF