ok, lets try this from scratch:
In your apache's httpd.conf:
ErrorDocument 404 /404.php
You can do it in the .htaccess file, but its just faster to put it in your conf. MAKE SURE THAT YOU DO NOT INCLUDE THE [url]http://[/url]<path> PART. I can't stress that enough.
Now, in 404.php:
<!-- header stuff here -->
<center><?="Sorry. The page you requested, <b>". $_SERVER["REQUEST_URI"] ."</b> does not exist"?></center>
<!-- All done! -->
Of course, you can do it the nice way if you don't have short tags turned on:
<!-- header stuff here -->
<center><?php
echo("Sorry. The page you requested, <b>". $_SERVER["REQUEST_URI"] ."</b> does not exist");
?></center>
<!-- All done! -->
Does that help at all?
[edit]
I was bored, so I made you the other option of not having it return the entire URL. For example, aaa/aaa.php?aaa=bbb would return the entire URL. This will return just aaa/aaa.php:
<?php
$requestf = explode('?', $_SERVER["REQUEST_URI"]);
echo("Sorry. The page you requested, <b>". $requestf[0] ."</b> does not exist");
?>