hello. well what i want is to know how to create an error page so that everytime people try to access a page that has been deleted, they get this personalized error page instead of just the regular "this page cannot be displayed"
hello. well what i want is to know how to create an error page so that everytime people try to access a page that has been deleted, they get this personalized error page instead of just the regular "this page cannot be displayed"
Actually, I think this is something that can be done nicely with PHP.
A 404 error will redirect to a single page based on any page not found.
That won't help much identifying a single file, though.
Using the information in the $_SERVER array, you can create a nice error page.
The info that will help, mostly, is in $_SERVER['REQUEST_URI'].
echo 'We're sorry, but '.$_SERVER['REQUEST_URI'].' was not found.';
Then you could also split the REQUEST URI for the various parts, such as the filename:
That should get you started.PHP Code:<?php
$a = explode('/',$_SERVER['REQUEST_URI']); //split at the slashes
$a = $a[count($a)-1]; //get the last bit (1 back because arrays start at 0)
echo $a; //now the filename
?>
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Eh, you will have to talk to your server's administrator...some servers allow you to upload your own 404 page.
Thou com'st in such a questionable shape
Hamlet, Act 1, Scene 4
Bookmarks