小编err*_*msg的帖子

htaccess拒绝所有和500内部服务器错误

我想限制直接访问本地服务器上的特定目录(以及其中的所有文件).目录是:C:/Server/www/project/html/

我尝试了下面的代码(.htaccess放在www目录 - /project/html /也不行):

<Directory "C:/Server/www/project/html/">
    AllowOverride all
        Order Deny,Allow
    Deny from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

但是,它会导致500内部服务器错误,我无法理解为什么.


Apache错误日志:

[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug …
Run Code Online (Sandbox Code Playgroud)

.htaccess

2
推荐指数
1
解决办法
8567
查看次数

标签 统计

.htaccess ×1