2017-01-14 09:06
浏览 116


I want to hide my uploads folder but i want to access it via php . Is this possible with .htaccess ? I tried something but didn't worked.

    <files "/uploads">
  order allow,deny
  deny from all

    <folders uploads>
Order Allow,Deny
Deny from all

图片转代码服务由CSDN问答提供 功能建议

我想隐藏我的 uploads 文件夹,但我想通过php访问它。 是否可以使用 .htaccess ? 我尝试了一些但没有用的。

 &lt; files“/ uploads”&gt; 
 order allow,deny 
 deny from all 
&lt; / files&gt; 
&lt; folders uploads&gt;  
&lt; / folders&gt; 
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • drgmszo076956 2017-01-14 09:19

    You're almost there, but it depends on what version of Apache you're using also.

    The above method you're trying is if you want to block access to a specific file, if you want to block a folder, then add your .htaccess file to that folder and just use:

    Below 2.4:

    deny from all

    2.4 or above:

    Require all denied
    解决 无用
    打赏 举报
  • 查看更多回答(1条)

相关推荐 更多相似问题