Click here to Skip to main content
15,883,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Morning,

There is a project that i am currently working on on php,html and css. problem is i have created a 404 page that needs to show up every time the user sends the page that does not exists within my web application. my question is , how can i implement that?

Thanks in advance.
Posted

1 solution

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


or edit apache's httpd.conf:
ErrorDocument 404 /notFound.php
 
Share this answer
 
Comments
Member 9303555 23-Jul-15 7:06am    
do i put this code on each and every page.
Andy Lanng 23-Jul-15 7:17am    
If I were you I would create a handlers.php to add items like this to and include it there. handlers should be on every page
Member 9303555 23-Jul-15 7:23am    
Thank you soo much Andy you have made my day.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900