用php输出3gp音频/视频

用php输出3gp音频/视频,php,android,.htaccess,mod-rewrite,Php,Android,.htaccess,Mod Rewrite,我有一个我无法解决的问题。 我在.htaccess中使用RewriteEngine来访问一些视频。我需要导出它们,以便在android中使用 我的.htaccess: RewriteRule ([^/]*)\.amr$ api.php?cmd=getmp3&hash=$1 [L] 在api.php中 $__GB->getSafemp3($_GET['hash']); 和功能部件代码: header('Content-Type: video/3gpp'); header('Con

我有一个我无法解决的问题。 我在
.htaccess
中使用RewriteEngine来访问一些视频。我需要导出它们,以便在
android
中使用

我的
.htaccess:

RewriteRule ([^/]*)\.amr$ api.php?cmd=getmp3&hash=$1 [L]
api.php中

$__GB->getSafemp3($_GET['hash']);
和功能部件代码:

header('Content-Type: video/3gpp');
header('Content-Disposition: inline; filename=' . $fetch['new_name']);
header('Content-length: '.filesize($path));
header("Content-Transfer-Encoding: binary");

readfile($path);
直接使用URL可以很好地工作,但不能重写规则

编辑: 我已经解决了问题,我更改了此功能部件的功能代码:

header('Location: ' . $path.$fetch['new_name']); //$path.$fetch['new_name'] is the file directory, ex: /music/audio.3gp