2012-01-15 82 views
0
之間Confilict

我有以下的PHP代碼RewriteEngine敘述和XSendFile

$filename = 'a56.flv'; 
$file = "C:/xampp/htdocs/site/flv/a56.flv"; 
header("Content-Type: application/force-download"); 
header('Content-Type: video/x-flv'); 
header('Content-Disposition: attachment; filename="' . addslashes($filename) . '"'); 
//header("Content-Type: application/octet-stream"); 
header("Content-Type: application/download; charset=UTF-8"); 
header("Content-Description: File Transfer"); 
header("X-Sendfile: $file"); 

當我直接調用腳本(HTTP://localhost/site/get2.php FTYPE = FLV &名= a56.flv)它工作正常,但只要用(HTTP://localhost/site/vsrc_a56.flv)調用返回404頁,這Apache的錯誤:

[Sun Jan 15 02:01:44 2012] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: xsendfile: unable to find file: flv/a56.flv 

凡我.htaccess文件就像如下:

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* 
AddDefaultCharset UTF-8 
#########ErrorDocument 404 
ErrorDocument 404 /site/404.php 
RewriteEngine On 
XSendFile on 
RewriteRule ^vsrc_(.*)$ ./get2.php?ftype=flv&filename=$1 [L] 

回答

1

嘗試重寫規則之前添加RewriteBase /site/

+0

它只有R標誌的RewriteRule工作^ _ VSRC(。*)$ ./get2.php?ftype=flv&filename=$1 [R,L] – Huseyin 2012-01-15 01:53:30