我遇到以下代码的问题,因为我的代码是htaccess
RewriteEngine On
# you can add whatever extensions you want routed to your php script
RewriteCond %{REQUEST_URI} \.(zip)$ [NC]
RewriteRule ^(.*)$ "pathoffile"/download_file.php [L]
and php code is
<?php
session_start();
if(!isset($_SESSION))
{
echo "Access Denied";
}
?>
当我点击以下链接时, 如果会话存在,应该下载文件,但不是。
答案 0 :(得分:0)
You can redirect all your file requests to a download_file.php?with=filename, then you can validate user section from there.