Error was encountered while trying to use an errordocument

New Page

404 Not found

The 404 Not Found HTTP response status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often referred to as dead or broken links and can be broken links.

A 404 status code only indicates that the resource is missing: not whether the absence is temporary or permanent. If a resource is permanently deleted, use status 410 (Missing) instead.


404 Custom Error Pages Not Found

You can display a custom 404 page to make it more useful to a user and provide guidance on what to do next. For example, for the Apache server, you can specify a path to a custom 404 page in an .htaccess file:

DocumentError 404 /notfound.html

To see an example of a custom 404 page, see this 404 page.

Note: Custom design is fine, in moderation. Feel free to make your 404 page humorous and human, but don’t confuse your users.


HTTP semantics #status.404

Browser compatibility report issues with this compatibility data on GitHub

desk portable






chrome android

Firefox for Android

android opera

Safari on iOS

Samsung Internet

Android web view


Full support

chrome yes

toggle history

Full support

edge 12

toggle history

Full support

firefox yes

toggle history

Full support

Opera Yes

toggle history

Full support

safari yes

toggle history

Full support

Android ChromeYes

toggle history

Full support

Firefox for Android Yes

toggle history

Full support

Opera Android Yes

toggle history

Full support

Safari on iOS Yes

toggle history

Full support

InternetSamsung Yes

toggle history

Full support

WebView Android Yes

toggle history


Tip: You can click/tap on a cell to get more information.

Full support Full support

The compatibility table on this page is generated from structured data. If you would like to contribute data, please visit and send us a pull request.

See also

  • 410
  • Wikipedia: HTTP 404

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report an issue with this content on GitHub
  • Do you want to solve the problem yourself? Consult our contribution guide.

Last modified: September 9, 2022, by MDN Contributors

Getting a 404 not found error when trying to use ErrorDocument


Asked 9 years, 11 months ago

Modified 7 years and 11 months ago

Seen 206,000 times

Report this ad

This question shows research effort; it is useful and clear


This question shows no research effort; it’s not clear or not helpful


Bookmark this question.

View activity on this post.

I know this thread has been discussed a lot on the web and here, and I tried almost every method, but I still have the same problem.

This is my URL on my local server (MAMP)


And I tried to insert a wrong path to take me to the wrong page, like below:


Instead of taking me to the error page, it displays:

Not Found The requested URL /hellothere/eiurgiuerib was not found on this server. Additionally, a 404 Not Found error was encountered while attempting to use an ErrorDocument to handle the request.

My 404 page is in the error directory. And in my .htaccess file I included this:

ErrorDocument 404 /Error/404.php

  • php
  • apache
  • .htaccess
  • status-code-http-404


Share a link to this question

Copy link CC BY-SA 3.0

improve this question


Follow this question to receive notifications

asked on October 6, 2012 at 1:47 p.m.

User avatar of user1725155

user1725155 user1725155

335 1 1 gold badge 3 3 silver badges 11 11 bronze badges


  • 1

    La page d’erreur personnalisée ne fonctionne pas. Donc qu’est ce que je devrais faire?

    – utilisateur1725155

    6 octobre 2012 à 14:06

  • pouvez-vous montrer votre schéma de dossier ?


    6 octobre 2012 à 14:17

  • Veuillez ne pas utiliser d’images pour afficher des données textuelles. Il dit que /Error/404.php est introuvable – Vérifiez l’orthographe, la casse et les autorisations de répertoire et de fichier. Vous devriez pouvoir invoquer 404.php à partir de l’adresse du navigateur — est-il trouvé ?

    – Phil Perry

    19 mai 2014 à 17:00

Ajouter un commentaire | 

2 réponses 2

Trié par : Réinitialiser par défaut

Score le plus élevé (par défaut) Tendance (les votes récents comptent plus) Date de modification (le plus récent en premier) Date de création (le plus ancien en premier)

Cette réponse est utile


This answer is not helpful

View activity on this post.

The ErrorDocument directive, when providing a local URL path, expects the path to be fully qualified from DocumentRoot. In your case, that means the actual path to the ErrorDocument is

ErrorDocument 404 /hellothere/error/404page.html


Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer


Follow this answer to receive notifications

answeredOctober 6, 2012 at 2:47 PM

StaticVariable user avatar

Static variable Static variable

5 243 4 4 gold badges 22 22 silver badges 45 45 bronze badges


  • Another thought, if in my index.php page I just add this line of code ” header(“HTTP/1.0 404 Not Found”); ” It won’t take me to the 404 page, why?

    – user1725155

    October 6, 2012 at 2:56 PM

  • @user1725155 you should read this post custom 404 not working


    October 6, 2012 at 3:00 PM

  • Thank you very much, I was repeatedly trying to beat this in apache from the server root not the document root.

    – kit r007

    February 8, 2019 at 3:43 PM

Add a comment | 

Report this ad

This answer is helpful


This answer is not helpful

View activity on this post.

When we apply the local URL, the ErrorDocument directive expects the full path of DocumentRoot. there forever,

ErrorDocument 404 /yourfoldernames/errors/404.html


Share a link to this answer

Copy link CC BY-SA 3.0

Improve this answer


Follow this answer to receive notifications

modified on October 4, 2014 at 10:44

NullPoiиteя user avatar


55.5k 22 22 gold badges 123 123 silver badges 140 140 bronze badges

answered Mar 8, 2013 at 6:19

User avatar of karthik k

karthik k karthik k

49 3 3 bronze badges

Add a comment  | 

Highly active question. Earn 10 reputation (not counting the association bonus) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.

Not the answer you’re looking for? Browse other questions tagged

  • php
  • apache
  • .htaccess
  • http-status-code-404

or ask your own question.

  • The Overflow Blog
  • Five nines uptime without developer burnout (Ep. 488)

  • We hate Scrum and Agile…when it’s done wrong (Ep. 489)

  • Featured on Meta
  • Recent Color Contrast Changes and Accessibility Updates

  • ¡Revisor por la borda! O una solicitud para mejorar la guía de incorporación para nuevos…

  • Dois-je expliquer les réponses en code des autres ?

Report this ad

Report this ad



PHP 404 header not working



How can I properly handle 404 in ASP.NET MVC?


Reference – What does this error mean in PHP?


ErrorDocument 404 /404.php not working in .htaccess file in PHP


Getting an error in codeigniter: A 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request


htaccess: error 404 not found when trying to ErrorDocument


htaccess – 404 redirect error


Xampp error “Additionally, a 404 Not Found error was encountered while attempting to use an ErrorDocument to handle the request.”

burning questions from the net

  • Python decibels with metric precision?
  • Will Gmail, Facebook and WhatsApp still be accessible in Macao and Hong Kong in 2022?
  • Practical consequences of the assumption of geometric cobordism
  • Which monoids have a faithful irreducible representation?
  • “Every Saturday and Sunday”? What is it about?
  • Can I create my own license?
  • How to copy a list of file creation dates from a Windows File Explorer to a spreadsheet
  • Find flights that do NOT stop in the United States
  • format of sections and subsections
  • Can stem+そう mean rumors?
  • How many syllables do these rules say ‘each’ has?
  • Difference between “unreal” and “not real”
  • Can Arcane Armor replace a missing eye?
  • Construct a sentence that makes sense
  • In what situations could a “dirty water leak in” municipal water lines be other than a catastrophic pressure loss?
  • For smashed burgers, are you supposed to wait for the meat to come off the pan before flipping it?
  • How do I request “open to”?
  • How important is having multiple gears on an e-bike?
  • Assistance with idempotent arrays
  • Are there any countries in Europe where there is a numerical threshold of 10% (or similar, but low) for minority language rights?
  • Can I bring my dog ​​to campus?
  • hide a continent
  • Does the key in which a piece is written affect the playability of the piano?
  • Can we obtain an infinite number of relations by applying alternately symmetric and transitive closures?

hotter questions

question flow

Subscribe to RSS

question flow

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Video Error was encountered while trying to use an errordocument

Related Posts

Free chat room code for my website

Contents1 How to set up a free chat room on the website.2 3 comentarios2.1 Trackbacks/Pingbacks2.2 Submit a Comment Cancel reply3 How to Create a Chat Room Website…

Background image full screen css

Contents1 Cómo – Full Page Image1.1 Example1.2 Example2 CSS background image tamaño tutorial: how to codify a complete page background image3 Perfect Full Page Background Image3.1 Méthode CSS géniale,…

WordPress leverage browser caching

Contents1 Aproveche el almacenamiento in hidden del navegador1.1 Will it works for my website?1.2 Where are plugin options1.3 Some JavaScript files still display under Leverage Browser Caching1.4…

WordPress post to facebook page

Contents1 How to Automatically Post to Facebook from WordPress1.1 Download Now: How to Launch a WordPress Website [Free Guide + Checklist]1.2 1. Create an IFTTT account.1.3 2….

Download images from wordpress media library

Contents1 How to export your WordPress media library1.1 Download maintenant : How to launch a WordPress website [Free Guide + Checklist]1.2 How to export your WordPress media…

WordPress single post template

Contents1 How to Create Custom Unique Post Templates in WordPress2 Post Template Files2.1 author.php2.2 Fecha.php3 Handbook navigation4 How to Create Custom Single Post Templates in WordPress5 Video…