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 6813115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:31:56+00:00 2026-05-26T20:31:56+00:00

I have 3 files: index.php,.htaccess,404.shtml index.php contains: <?php header($_SERVER[SERVER_PROTOCOL]. 404 Not Found); ?> .htaccess

  • 0

I have 3 files: index.php,.htaccess,404.shtml

index.php contains:

<?php
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); 
?>

.htaccess contains:

ErrorDocument 404 /404.shtml

404.shtml contains:

Hello World

when i visit index.php my browser tells me oops something went wrong. What might possibly have gone wrong?

  • 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-26T20:31:57+00:00Added an answer on May 26, 2026 at 8:31 pm

    I think because .htaccess comes first and the server would redirect to it only if the physical file really doesn’t exists.

    If you handle 404 via php header you should handle it either for real user eg. with

     <?
     header("Location: /this/page/really/not_exists.404"); //  trigger "real" 404
     //or
     header("Location: /404.shtml");
    

    for reference try looking here
    Why won't my PHP app send a 404 error?

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

Sidebar

Related Questions

In my htaccess file my ErrorDocument 404 statement is not redirecting to index.php. Instead,
I have .htaccess already configured: ErrorDocument 404 error.php But whenever I go to an
I have the following .htaccess to force all files to go through a index.php
I have a header('HTTP/1.0 404 Not Found'); somewhere along the code but it doesn't
I have an htaccess file that uses mod_rewrite to redirect /controller to /index.php?controller=%controller% Like
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php
I have a index.php file that will include several external files: content/templates/id1/template.php content/templates/id2/template.php content/templates/id3/template.php
I have: $page_file_temp = $_SERVER[PHP_SELF]; which will output: /templates/somename/index.php I want to extract from
I have a couple of files named like index.php?page=1, news?id=1. How can I set

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.