mp3.php
<?php
$canshu=$_SERVER["QUERY_STRING"];
$wangzhi="http://pan.baidu.com/share/link?".$canshu;
$file=file_get_contents($wangzhi);
$pattern='/<a class="dbtn cancel b-fr" href=(.*?)id="downFileButtom">/is';
preg_match_all($pattern,$file,$result);
$tempurl=implode("",$result[1]);
$fileurlt=str_replace("\"","",$tempurl);
$fileurl=str_replace("&","&",$fileurlt);
header("location:$fileurl")
?>
mp3.php/?shareid=###&uk=###
mp3.php/shareid/###/uk/###.mp3
做QQ空间背景音乐使用url重写
.htaccess
#GZIP#
<ifmodule mod_deflate.c>
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE css js txt php xml html htm
</ifmodule>
#时区#
SetEnv TZ Asia/Hong_Kong
#编码#
AddDefaultCharset UTF-8
#url重写#
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/mp3.php/shareid/([0-9]+)/uk/([0-9]+)\.(mp3|rar|jpg|gif|zip) /mp3.php?shareid=$1&uk=$2 [L]
</IfModule>