I have a custom 404 page for a server serving only MP3s that I want to send a default 'MissingAudio.mp3' file to the client.
When the non-existent MP3 file is requested, FF says that it can't find the file, the original 'non-existent' file name, not the one defined in the 404 page.
I have used the core of this page (changing the content headers to send MP3) many times in the past without problems. It just doesn't seem to work as a custom 404 page.
//Custom 404 error page
//missing.php
$filepath = "NoLongerAvailable.mp3";
$path = "./";
$filename = basename($filepath);
$total = $path.$filepath;
header('Content-type: audio/mpeg');
header('Content-Disposition: attachment; filename=' . $filename . ';');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($total));
readfile($total);
exit();
Any thoughts?
Thanks