【发布时间】:2023-03-04 02:58:02
【问题描述】:
我将 .htaccess 上传到服务器并收到 错误 500(内部服务器错误)。
在错误日志中我有以下错误:
.../.htaccess:此处不允许使用 RewriteEngine
但mod_rewrite.so 已启用。
那么,我需要改变吗
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
到
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
在 /etc/httpd/conf/httpd.conf 文件中?
或者是别的什么? .htaccess 文件应该没问题,因为它在我的本地主机上运行良好。我只是不想搞砸任何事情。
这是我的 .htaccess 文件的一部分:
Options All -Indexes
Options +FollowSymLinks
RewriteEngine On
【问题讨论】:
-
是的,这都是关于
AllowOverride指令的。不需要AllowOverride All.. 但至少AllowOverride FileInfo。详情:httpd.apache.org/docs/current/mod/core.html#allowoverride -
错误日志显示的就是这些?
-
@linuxeasy 是的。路径和 .htaccess: RewriteEngine 不允许在这里。就是这样。
-
@lazyone,谢谢,我试试看。
标签: .htaccess mod-rewrite apache httpd.conf