Solution for “RewriteEngine not allowed here” in WordPress
This error occurs because your server is not configured to let .htaccess files override Apache settings. In Apache, the AllowOverride directive controls what types of rules are permitted inside .htaccess files.
Step-by-Step Fix
-
Locate the Apache Configuration
Open your Apache/XAMPP configuration files. These are usually found in:or inside:
-
Find or Add the
<Directory>Block
Inside your configuration, look for the<Directory>container that matches your WordPress installation path.
For example:🔹 Replace
/path/to/your/xampp/wordpresswith the absolute physical path to your WordPress folder (not the URL path). -
Set the Override Rules
Instead of restricting it to justFileInfo, allow all overrides:Or, if you want a stricter setup:
This enables mod_rewrite directives inside your
.htaccessfile. -
Restart Apache
After making changes, restart Apache/XAMPP for the new settings to take effect.
✅ Once done, your .htaccess rules—like WordPress’s permalink rewrites—will work correctly without throwing the “RewriteEngine not allowed here” error.