doufu5401 2013-09-14 09:14
浏览 39
已采纳

Codeigniter .htaccess:授予所有文件的公共访问权限,但不授予文件夹

my file format like

  application
       - controllers
       - views etc...
  assetes
       - Images
       - Css etc...

and my .htaccess file are below:

#Deny from all
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

My problem is that assets folder access to every one any user veiw all images and all css file but needed is only user access assets folder file not the access entire folder

please help me thanks!

  • 写回答

2条回答 默认 最新

  • dongni3854 2013-09-14 10:01
    关注

    Blocking directory access can be done by simply putting a index.html file in the folder you want to block directory access to.

    This is the way the standard CodeIgniter install does it. The below index.html file can be found in the application\controllers folder.

    <html>
    <head>
        <title>403 Forbidden</title>
    </head>
    <body>
        <p>Directory access is forbidden.</p>
    </body>
    </html>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效