我将 .htaccess 上传到服务器后,收到了一个 Error 500 (Internal Server Error)。
在错误日志中,我看到了以下错误:
.../.htaccess: RewriteEngine not allowed here
但是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
。详情请参见:http://httpd.apache.org/docs/current/mod/core.html#allowoverride - LazyOne