Tried $REDIRECT_URL, $HTTP_REFERER and $REQUEST_URI. None of them will give the right result.
If I type in a known wrong URL or click a broken link I get for the three above:
$REDIRECT_URL: My 404-file itself
$HTTP_REFERER: The last correctly shown page
$REQUEST_URI: My 404-file itself
But where is my offending URL?
Martin