这里不允许使用RewriteEngine(Apache2)

时间:2016-10-28 17:45:11

标签: apache .htaccess mod-rewrite

我使用了普通配置并添加了

LoadModule rewrite_module modules/mod_rewrite.so

DocumentRoot "C:/Projects/web/"

Alias / "C:/Projects/web/" 
<Directory "C:/Projects/web">
    Options Indexes FollowSymLinks Includes ExecCGI
    Require all granted
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

我的.htaccess看起来像:

RewriteEngine On
RewriteRule ^(..)/([^/]+)$ /index.php?lang=$1&cat=$2 [L]
RewriteRule ^(..)/([^/]+)/([^/]+)$ /index.php?lang=$1&cat=$2&sub=$3 

正则表达式是正确的。在我得到的日志文件中:

[Fri Oct 28 19:37:50.483153 2016] [core:alert] [pid 5508:tid 1056] [client ::1:49898] C:/Projects/web/.htaccess: RewriteEngine not allowed here
[Fri Oct 28 19:37:51.385204 2016] [core:alert] [pid 5508:tid 1056] [client ::1:49899] C:/Projects/web/.htaccess: RewriteEngine not allowed here

我试图通过设置LogLevel alert rewrite:trace8LogLevel debug来获得更详细的输出,但它没有帮助。

0 个答案:

没有答案