站点下有子文件夹  script  文件夹下有js文件index.js根目录下有文件index.php
想权限设置成直接通过URL:http://www.abc.com/script/index.js无法访问,需要权限
但是通过index.php的<script src='/script/index.js'></script>是可以执行的
请教大家要怎么设置?

解决方案 »

  1.   

    http://www.phpwind.net/template/wind/index.htm比如这种
    是有必要设下权限
      

  2.   

    试试这个吧:.htaccess(这是完整的文件名,copy到相关目录)文件的内容:
    <Files "/script/index.js">
    Order Allow,Deny
    Deny from All
    </Files><Files "/template/wind/index.htm ">
    Order Allow,Deny
    Deny from All
    </Files>
      

  3.   

    location  /  {
    : auth_basic            "Restricted";
    : auth_basic_user_file  conf/htpasswd;
    }