Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4172626
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:35:09+00:00 2026-05-21T00:35:09+00:00

I have a 404.php file in my site’s main directory and I was using

  • 0

I have a 404.php file in my site’s main directory and I was using header('Location: 404.php'); for a while until someone said that you should use header('HTTP/1.0 404 Not Found'); instead. So I replaced it with that and then added: ErrorDocument 404 /404.php to my apache config file and restarted the server but it doesn’t work.

I tried different variations including ErrorDocument 404 404.php and ErrorDocument 404 mywebite/404.php but to no avail.

What I mean by doesn’t work is that earlier when using header('Location: 404.php'); it would redirect to the 404.php file but when I replace it with header('HTTP/1.0 404 Not Found'); it seems to just skip over the line and not do anything. It most certainly is not redirecting. The reason I am calling for the redirect is because if a $_GET header value is not recognized the page should 404.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T00:35:10+00:00Added an answer on May 21, 2026 at 12:35 am

    No, it probably is actually working. It’s just not readily visible. Instead of just using the header call, try doing that, then including 404.php, and then calling die.

    You can test the fact that the HTTP/1.0 404 Not Found works by creating a PHP file named, say, test.php with this content:

    <?php
    
    header("HTTP/1.0 404 Not Found");
    echo "PHP continues.\n";
    die();
    echo "Not after a die, however.\n";
    

    Then viewing the result with curl -D /dev/stdout reveals:

    HTTP/1.0 404 Not Found
    Date: Mon, 04 Apr 2011 03:39:06 GMT
    Server: Apache
    X-Powered-By: PHP/5.3.2
    Content-Length: 14
    Connection: close
    Content-Type: text/html
    
    PHP continues.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following PHP code $filename = 'a56.flv'; $file = C:/xampp/htdocs/site/flv/a56.flv; header(Content-Type: application/force-download); header('Content-Type:
I'm trying to return a custom 404 page using IIS6. (I have a site
I currently have my .htaccess file as the following: ErrorDocument 404 /404.php RewriteEngine on
I have a website which uses the custom 404 error handling in PHP/Apache to
I have a very simple .htaccess file set up to redirect a 404 to
I have a very simple MVC site that is returning a 404 not found
For example I have site http://localhost/site In IIS I set that 404 error causes
I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However,
Have just started using Google Chrome , and noticed in parts of our site,
I have a site that has an admin page (eg admin.php) that is normally

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.