.htaccess:此处不允许使用 RewriteEngine

标签 .htaccess mod-rewrite apache httpd.conf

我将 .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/

相关文章:

php - PHP 中的依赖注入(inject)

jquery - URL 重写 - 删除哈希值

.htaccess - 用.htaccess替换URL的一部分

.htaccess - 如何使用 ssl 包含相对 url

angular - Tomcat 重写Cond

仅 VPN 网站上的 Java HTTP 请求

apache - 如何为 Apache 2.4/ubuntu 13.10 及以上版本设置虚拟主机?

apache - 请更多关注我可怜的 mod_rewrite 尝试

java - Apache http 发布示例

linux - 在 Firefox 中打开具有特定扩展名的文件