2

I used a plain config and added

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>

My .htaccess looks like:

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

The regex are correct. In the logfiles I got:

[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

I tried to get more verbose output by setting LogLevel alert rewrite:trace8 and LogLevel debug but it doesn't help.

MarcS82
  • 2,065
  • 7
  • 29
  • 46
  • I think that the solution is [here](http://stackoverflow.com/questions/6995545/htaccess-rewriteengine-not-allowed-here) in another post – Emiliano Oct 28 '16 at 17:55
  • I already set **AllowOverride All** in the Section – MarcS82 Oct 28 '16 at 17:59
  • did you read all post, comments and responses? There are a lot info in that post, please, read it, it is not only AllowOverride All – Emiliano Oct 28 '16 at 18:16
  • Yes I read everything and some other posts with the same topic before I had opened my own. – MarcS82 Oct 28 '16 at 18:22
  • Did you restart apache when you enabled the rewrite module? – Panama Jack Oct 28 '16 at 18:27
  • Yes, I did restart apache. – MarcS82 Oct 28 '16 at 18:37
  • @MarcS82 do you tried enable the module instead add this line to the virtual host? LoadModule rewrite_module modules/mod_rewrite.so – Emiliano Oct 28 '16 at 18:38
  • I mean using the command a2enmod – Emiliano Oct 28 '16 at 18:39
  • I'm on windows. I had mod_rewrite working on another website some time ago so the module should work correctly. – MarcS82 Oct 28 '16 at 18:47
  • Possible duplicate of ["RewriteEngine not allowed here" .htaccess error using XAMPP](http://stackoverflow.com/questions/13277986/rewriteengine-not-allowed-here-htaccess-error-using-xampp) – Walf Nov 02 '16 at 13:09
  • 1
    Have you searched, case-insensitively for *all* instances of `AllowOverride` in *all* configuration files? Try [grepWin](http://stefanstools.sourceforge.net/grepWin.html). – Walf Nov 02 '16 at 13:14

0 Answers0