Errordocument to handle the request

New Page

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

This question shows research effort; it is useful and clear


This question shows no research effort; unclear or not useful


Please mark 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

To share

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éponses2

Trié par : Réinitialiser par défaut

Score é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


Cette réponse n’est pas utile

View activity on this post.

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

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 | 

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 the DocumentRoot. So,

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 insignes d’or 123 123 insignes d’argent 140 140 insignes de bronze

répondu le 8 mars 2013 à 6:19

User avatar of karthik k

karthik k karthik k

49 3 3 insignes de bronze

Ajouter un commentaire | 

Question très active . Gagnez 10 points de réputation (sans compter le bonus d’association) afin de répondre à cette question. L’exigence de réputation aide à protéger cette question contre les spams et les activités sans réponse.

Pas la réponse que vous cherchez? Parcourir les autres questions étiquetées

  • php
  • apache
  • .htaccess
  • code-de-statut-http-404

ou posez votre propre question.

  • Le blog à débordement
  • Tendances de débordement de pile : activité du site en semaine et le week-end

  • Ne laissez pas le logiciel vous voler votre temps (Ep. 491)

  • Présenté dans Meta
  • Modifications récentes du contraste des couleurs et mises à jour d’accessibilité

  • Reviewer overboard! Or a request to improve the onboarding guide for new…

  • Collective update: recognized members, articles and GitLab

  • Do I need to explain other people’s answers in code?



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

Network burning questions

  • Total length of intersecting lines – comparing multiple lines to each other
  • Can a smooth manifold be realized as the image of a smooth function?
  • Any advice for writing scenes between characters where there is no action?
  • var() is not equal to sd()^2 in R
  • Slovakia was the first state that did not affirm Sweden and Finland’s NATO membership with a huge majority – why?
  • Is James Earl Jones the actor who has played the same sci-fi character the longest?
  • How is the estimated approach time expressed in ATC communications?
  • Short horror story I read in the 70’s where the protagonist witnesses a monster disguised as a human eat someone
  • Why does Scarecrow in The Wizard Of Oz get the Pythagorean Theorem wrong?
  • Is my homebrew Hiccupera spell any good?
  • Mapping Diagram with Parallelograms
  • What video game is being played in Spiderhead (2022)?
  • Overstayed in UK on student visa
  • Pronunciation of proper names in PF2e’s Mwangi Expanse
  • Python decibel meter-accurate?
  • Is there a routine like FETCH, STASH and SWAP for transfering data between memory bank 0 and 1 on the C128?
  • Does the Wizard’s Spell Mastery spells need to be prepared as a Wizard or can they be “known”?
  • Display Long Trigonometric Identity Manipulation
  • Splitting and rejoining a trace to reduce resistance
  • Is there any known thing or physical object that absolutely cannot be destroyed?
  • Is naturalism falsifiable?
  • Why doesn’t R use inverse transform sampling to sample from the exponential distribution?
  • Vagueness rather than specificity when the risks are enormous
  • Need to replace a charged mower battery that reads less than 12 volts?

hotter questions

question flow

Subscribe to RSS

question flow

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

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

Video Errordocument to handle the request

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…