PDA

View Full Version : Can you have a PHP 404 file?


Gaz
11-10-2000, 01:36 AM
Can you have[nbsp][nbsp]a PHP 404 file?

I guess the first question that I should ask is:

1) Could you get the $HTTP_REFERER information from a 404 page? Right now I have a number of pages not found, while I'm pretty confident the internal pages do not have broken links to these pages, we are no closer to determine where the broken page is!

2) If you can get useful information from $HTTP_REFERRER, can you have a php enabled 404 page?

I tried just using the standard php extension inplace of my 404.html file, but that didnt work!

Any ideas would be greatly appreciated!

Gareth

Dan Kaplan
11-10-2000, 02:17 AM
Have you tried changing your .htaccess file?

ErrorDocument 404 /404.php

Dan

Justin
11-10-2000, 03:46 PM
The information you're looking for will be in your log files. The easiest way to find the referer would be to grep for '404', and look at the referer for each one:
</font><font face="Courier" size="3">
$ cd /big/dom/xyourdomain/logs_web
$ zcat access.20001109.gz | grep 404
</font><font face="Verdana, Arial" size="2">
Replace 20001109 with the date you want to examine (the file naming will vary between servers; try 'ls' once in the logs directory for exact file names. Use 'zcat' for .gz files, and 'cat' for non-gz files).

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support

Gaz
11-11-2000, 03:16 AM
Perfect answers from both of you! Sorry if I seemed a little dim, I'm more familiar with IIS (yes I know!) than Apache.

Many thanks,

Gareth