Re: Maybe OT but I was wondering....
| From: | CC Zona | Date: | Tue, 08 Jan 2002 20:48:39 +0000 |
| Subject: | Re: Maybe OT but I was wondering.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79820@lists.php.net to get a copy of this message | ||
In article <OE36A5Sw15HpVEhz2tC0000de54@hotmail.com>,
turnball_@hotmail.com (Ben Turner) wrote:
> I am trying to find somewhere that I can identify a custom 404
> error page and then pull the page based on the document directory.
If you just want to customize your 404 page (presumably to call a PHP
script?), your web server documentation should be of assistance. For
instance, Apache's ErrorDocument directive
<http://httpd.apache.org/docs/mod/core.html#errordocument>
is quite simple
to implement, as long as the hosting setup at least permits use of an
.htaccess file.
By "pull the page based on the document directory" do mean that you want to
display different versions of a 404 page depending upon what URL resulted
in the 404 status? For instance, /dir1/badpath1 would get "No such page,
bozo" while /dir2/badpath2 would get "That page is not available, but
here's our site map instead", etc.? If so, then you may want to direct all
404s to a single PHP script, then let the script generate appropriate
output based on an env var such as PHP_SELF, REQUEST_URI, SCRIPT_NAME (see
phpinfo() for a bunch of possibilities).
--
CC