Search code examples
htmlapache.htaccesshttp-redirecthttp-status-code-404

My website found the 404 error page but don't show a page content, only write the file name


I'm trying to create and normal error 404 redirection page. Everything works great, but I have a little issue trying to fix.

When I get an error 404 for example its open and specific page in my case I use:

RewriteEngine On
RewriteRule ^ERROR 404.php [NC,L]
ErrorDocument 404 error

My 404 error page is working well. But shows this when I get and 404 error:

enter image description here

Shows the file name and not the content inside!

Thank you! Hope you understand my question.


Solution

  • I found the solution:

    Use:

    ErrorDocument 404 http://localhost/404.php
    

    Thank you!