.htaccess deny files in subfolders

后端 未结 4 815
不思量自难忘°
不思量自难忘° 2021-02-02 01:33

I want to block access to \"sub/folder/index.php\", but not \"index.php\" anywhere else.


    Order allow,deny
    Deny from all
         


        
4条回答
  •  臣服心动
    2021-02-02 01:39

    How about creating a .htaccess file in the specific folder containing the files you want to protect?

    Edit:

    Be careful, this actually does not work in a simple .htaccess file, see comments below. This will only work in an apache.conf file.

    This should to the trick for you without another .htaccess file:

    
       
         Order allow,deny
         Deny from all
       
    
    

提交回复
热议问题