Deny access to all files in a directory unless a specific php page is referrer

后端 未结 1 803
南旧
南旧 2021-01-15 01:35

We have files stored in a directory \"uploads/downloads\" which are accessed through a php file in the manner of https://www.example.com/request_file.php?file=123. That PHP

相关标签:
1条回答
  • 2021-01-15 01:58

    Try something like this:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !request_file.php
    RewriteRule ^uploads/downloads/ - [L,R=404]
    
    0 讨论(0)
提交回复
热议问题