gpt4 book ai didi

apache - .htaccess 不被 apache 读取

转载 作者:行者123 更新时间:2023-12-04 18:55:16 24 4
gpt4 key购买 nike

我的 .htaccess 文件包含垃圾值,例如

'dfdfsdfdsfdfdf'

另一个文件 httpd.conf(/etc/apache2/httpd.conf) 不包含任何内容

我希望至少 .htaccess 文件能够执行并将页面显示为
internal server error
我还更改了代码并更改了两个文件(.htaccess 和 httpd.conf),但页面 index.php 显示为好像没有两个文件(.htaccess 和 httpd.conf)。

原因是什么?

最佳答案

httpd.conf应包含 AllowOverride All用于文档根目录。

DocumentRoot "D:/Projects/Example/htdocs"
<Directory "D:/Projects/Example/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

否则,使用 .htaccess文件被禁用。

关于apache - .htaccess 不被 apache 读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13702639/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com