Title: Error: The Apache mod_rewrite module is not enabled&#8230;
Last modified: November 24, 2021

---

# Error: The Apache mod_rewrite module is not enabled…

 *  Resolved [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/)
 * I received this error every time I tried to change the setting “Protect admin
   scripts”. mod_rewrite absolutely is enabled on my lamp stack.
 * I think the problem lies in “cerber-common.php”, line 2,893:
 * `if ( ! apache_mod_loaded( 'mod_rewrite', true ) ) {`
 * I don’t know whether this is a WordPress issue or a Cerber issue.
    -  This topic was modified 4 years, 6 months ago by [Llewen](https://wordpress.org/support/users/llewen/).
    -  This topic was modified 4 years, 6 months ago by [Llewen](https://wordpress.org/support/users/llewen/).
    -  This topic was modified 4 years, 6 months ago by [Llewen](https://wordpress.org/support/users/llewen/).

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100326)
 * edit: Fix didn’t work.
    -  This reply was modified 4 years, 6 months ago by [Llewen](https://wordpress.org/support/users/llewen/).
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100546)
 * You can check the loaded modules by creating a temporary test PHP file with phpinfo()
   in the root folder and opening it in a browser. See more: [https://www.php.net/manual/en/function.phpinfo.php](https://www.php.net/manual/en/function.phpinfo.php)
 * **Do not forget to remove the file after tests.**
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100660)
 * I’ve double, triple, quadruple, quintuple, sextuple, checked, rechecked, gone
   back months later and done it all again. mod_rewrite is absolutely enabled. It’s
   in my /etc/apache2/mods-available, the symlink is in /etc/apache2/mods-enabled..
   htaccess contains the following code:
 *     ```
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
       ```
   
 * /usr/lib/apache2/modules contains mod_rewrite.so, so that’s there as well. phpinfo()
   also lists it, as follows.
 * `Loaded Modules core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version
   mod_unixd mod_access_compat mod_alias mod_auth_basic mod_authn_core mod_authn_file
   mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate
   mod_dir mod_env mod_filter mod_headers mod_mime prefork mod_negotiation mod_php7
   mod_reqtimeout mod_rewrite etc.`
 * I’ve also tried AllowOverride All, just to be sure that wasn’t the issue. It 
   made no difference.
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100798)
 * What version of PHP do you run? Does apache_mod_loaded() always return the same
   result for any other Apache module installed on the server, including a random
   string?
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100905)
 * Here’s a link to the phpinfo ( ) as a pdf. I tried to remove all the possible
   dox data, but I can’t be sure I got it all. I’ll delete the file and remove the
   link when I know you have it.
 * [phpinfo](https://filedn.com/lWbVXB4SbxPYfgQyS6OHlxF/phpinfo.pdf)
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100918)
 * The “Microsoft IIS 5.0” is my little joke on hackers attempting to hack the website…
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100923)
 * On the off chance that you think Mod Security is the issue, I have attempted 
   to disable it, to no effect.
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15100957)
 * Just to be double sure, I disabled modsecurity entirely, and encountered the 
   same error.
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15101322)
 * I’m not really good with WordPress or with PHP, so this was a bit of fun, but
   as far as I can see, unless I am running into permissions issues, apache_mod_loaded
   always returns FALSE.
 * I ran this code on various bits of the admin page, using different mod names 
   and just a random string, and it always returned FALSE. But perhaps I was just
   plugging it into the wrong place. I’m a hack when it comes to scripting. I’m 
   not really skilled.
 *     ```
       <div>
       <?php
       if ( apache_mod_loaded( 'mod_rewrite' ) ) {
           echo "TRUE";
       } else {
           echo "FALSE";
       }
       ?>
       </div>
       ```
   
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15101443)
 * I double checked the documentation. That function doesn’t appear have any specific
   scope, so it should run on any page, and it returned false no matter what page
   I ran it on, no matter what data I fed it.
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15101450)
 * I think I figured it out. My little joke backfired on me. Changing the server
   string messed up the contents of the “$is_apache” variable. That might well be
   why a bunch of other things that I’ve never been able to figure out are broken
   in my WordPress. I’ll post back when I know for sure.
 *  Thread Starter [Llewen](https://wordpress.org/support/users/llewen/)
 * (@llewen)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15101458)
 * Ya, that was it. Thanks for your help. I’m not sure why disabling modsecurity
   didn’t also disable that, but it didn’t. That was also the reason for a lot of
   the other issues I’ve been having with WordPress. Lesson learned.
 *  Plugin Author [gioni](https://wordpress.org/support/users/gioni/)
 * (@gioni)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15103582)
 * Good news!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Error: The Apache mod_rewrite module is not enabled…’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-cerber_77a9bf.svg)
 * [WP Cerber Security, Anti-spam & Malware Scan](https://wordpress.org/plugins/wp-cerber/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cerber/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cerber/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cerber/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cerber/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cerber/reviews/)

 * 13 replies
 * 2 participants
 * Last reply from: [gioni](https://wordpress.org/support/users/gioni/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/error-the-apache-mod_rewrite-module-is-not-enabled/#post-15103582)
 * Status: resolved