提问者:小点点

.htaccess目录内部服务器错误[重复]


在本地主机上,我使用php内置服务器,并希望阻止一些目录。

<Directory /config/>
    Options +Indexes
    IndexOptions +FancyIndexing
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

但是在我的debian apache2服务器上,我得到了一个内部服务器错误。Apache2错误日志:

[Tue Dec 21 08:38:31.577748 2021] [core:alert] [pid 30883] [client xxx:42012] /var/www/html/.htaccess: <Directory not allowed here

共1个答案

匿名用户

在apache2内部。我使用的配置文件

<Directory /var/www/html/config/>
        Options +Indexes
        IndexOptions +FancyIndexing
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1