htaccess mod重写文件先通过php?
我有一个充满文件的目录。
最初人们被允许直接链接到这些文件。现在我想首先通过 php 文件运行所有文件。
有人可以帮我解决所需的 .htaccess 吗?用于处理下载的 phpfile 将被称为 download.php,它将有一个名为 $ref 的 get 变量,
所以我需要 noob.com/games.zip 转到 noob.com/download.php?ref=games.zip 但仍然保留 noob.com/games.zip 的 url
谢谢!
I have a directory full of files.
Originally people were allowed to direct link to these files. Now i would like to run all files through a php file first.
Could someone help me with the .htaccess needed to do that? The phpfile used to handle the downloads will be called download.php and it will have a get variable called $ref
So i need noob.com/games.zip to goto noob.com/download.php?ref=games.zip BUT still retaining the url of noob.com/games.zip
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以为您完成工作:
...如果您还想保留其他参数...
This should do the job for you:
...and this is if you want to keep other parameters also...