doujiang6944 2013-12-05 06:38
浏览 22

拒绝访问除服务器本身之外的.php文件

How can I write a .htaccess script that prevents the user from running .php files in a certain directory and it's child directories?

I would need to be able to include the php file from the servers index.php or other files though, basically I want to enable to the server to to include the php files from a certain directory but, if the user were to type in the specific URL, it would deny access.

  • 写回答

2条回答 默认 最新

  • dongxian6653 2013-12-05 06:41
    关注

    This could do the trick

    <FilesMatch "\.php$">
       Deny from all
    <FilesMatch>
    

    Also, see the answers to this question: Deny direct access to all .php files except index.php

    评论

报告相同问题?