.htaccess,<Directory />,内部服务器错误,500

问题描述 投票:0回答:1

我在htaccess文件中

<Index "">
<Files "*.php">
Order Reject, Allow
Reject All
</Files>

我给出了

</Directory>
命令,但它给出了内部错误。 请帮忙,为什么会出现这种情况?我不使用 WordPress,我的网站在 VDS 上。

<Directory "C:\xampp\htdocs">
<Files "*.php">
Order Deny,Allow
Deny from All
</Files>
</Directory>
apache .htaccess
1个回答
0
投票

不能在.htaccess中使用

Directory
指令。

当您检查文档时,https://httpd.apache.org/docs/2.4/mod/core.html#directory,它说:

上下文:服务器配置、虚拟主机

- 这意味着,该指令可以在主服务器配置文件中使用,或者在

VirtualHost
容器中使用 - 但不能在 .htaccess 中使用。

https://httpd.apache.org/docs/2.4/mod/directive-dict.html#Context

© www.soinside.com 2019 - 2024. All rights reserved.