我将 .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
最佳答案
.htaccess 工作的最低配置:
AllowOverride FileInfo Options
允许所有配置也将起作用:
AllowOverride All
关于.htaccess:此处不允许使用 RewriteEngine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6995545/