Fixing .htaccess in WordPress for “Rewrite Engine not allowed here”

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

  1. Locate the Apache Configuration
    Open your Apache/XAMPP configuration files. These are usually found in:

    /xampp/apache/conf/httpd.conf

    or inside:

    /xampp/apache/conf/extra/httpd-vhosts.conf
  2. Find or Add the <Directory> Block
    Inside your configuration, look for the <Directory> container that matches your WordPress installation path.
    For example:

    <Directory "/path/to/your/xampp/wordpress">
    AllowOverride All
    </Directory>

    🔹 Replace /path/to/your/xampp/wordpress with the absolute physical path to your WordPress folder (not the URL path).

  3. Set the Override Rules
    Instead of restricting it to just FileInfo, allow all overrides:

    AllowOverride All

    Or, if you want a stricter setup:

    AllowOverride FileInfo

    This enables mod_rewrite directives inside your .htaccess file.

  4. 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.