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

  • SEARCH
  • Home
  • 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 9101345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:06:24+00:00 2026-06-17T01:06:24+00:00

Trying to redirect a page to my custom 404 error document, but in vain.

  • 0

Trying to redirect a page to my custom 404 error document, but in vain.
Heres the code

header('HTTP/1.1 404 Not Found', true, 404); 

But it stays on the same page even though the header information changes as required

HTTP/1.1 404 Not Found
Date: Wed, 09 Jan 2013 18:10:44 GMT
Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.8

PHP page continues and no redirect is achieved!

  • 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-06-17T01:06:25+00:00Added an answer on June 17, 2026 at 1:06 am

    You should just do header("Location: /errors/junk.php"); as that’s essentially what Apache does with custom error documents, just on the server level instead of in PHP. I believe Apache uses a 301 redirect, but I could be wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to show an HTTP error document from a PHP page, but I
I am trying to redirect users to a custom error page (for example: error.php)
I am trying to redirect a page via my .htaccess, but it does not
I am trying to redirect erroneous page requests - 404 errors - to a
I'm trying to get the custom 404 page we've built to display instead of
Hello? I am trying to redirect a particular user to a custom page once
I'm trying to throw an HTTP 403 error code back at the client. I've
I am trying to serve a custom error page in an MVC2 app, which
We are currently using a custom error page for 404 errors for our Web
I'm trying to redirect unauthorized users to a custom page when they are accessing

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.