我希望重写一个特定的URl与php


I am looking to re-write a specific URl with php

我正在使用PHP脚本将我的下载链接更改为"http://mydomain.com/get.php?download/",但是我希望进一步更改这只显示"/get.php?下载/或更具体的东西,如"?"Php "在我的网页上的按钮持有链接。

下面是我的代码:
<?php
$path = 'folder/blank.file/';
$mm_type="application/octet-stream";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)) );
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary'n");
readfile($path); //output
exit();
?>

这怎么可能?谢谢你的帮助!

编辑:我使用lighttpd和invision电源板

我不知道你是否已经做了这个(这是一个老问题)…但我有个办法也许能帮上忙。

重写,在IPB中可以更改核心文件…看看这里:

{forum-root}/admin/applications_addon/ips/下载/扩展/furlTemplates.php

in "idmdodownload"看一下这一行:

'out' => array( '/app=downloads(&amp;|&)module=display(&amp;|&)section=download(&amp;|&)do=do_download(&amp;|&)id=(.+?)(&|$)/i', 'files/download/$5-#{__title__}/$6' ),

你可以重写,我想你可以得到你想要的…

看看->我写的关于IPB重写的文章